Skip to content

Commit

Permalink
Merge pull request #2083 from DEFRA/develop
Browse files Browse the repository at this point in the history
SEMVER - (MINOR): Release 1.55.0
  • Loading branch information
jaucourt authored Nov 26, 2024
2 parents 3405322 + 73ce537 commit 85c51bf
Show file tree
Hide file tree
Showing 53 changed files with 921 additions and 1,632 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: npm ci
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
- name: Run versioning script
run: . ./scripts/github/deploy.sh
Expand Down
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@

## v1.55.0-rc.6 (2024-11-25)

#### :rocket: Enhancement
* `fulfilment-job`
* [#2070](https://github.com/DEFRA/rod-licensing/pull/2070) Remove ftp image and build ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.55.0-rc.5 (2024-11-25)

#### :rocket: Enhancement
* `fulfilment-job`, `pocl-job`
* [#2064](https://github.com/DEFRA/rod-licensing/pull/2064) Remove ftp functionality ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.55.0-rc.4 (2024-11-21)

#### :rocket: Enhancement
* `connectors-lib`, `gafl-webapp-service`, `sales-api-service`
* [#2074](https://github.com/DEFRA/rod-licensing/pull/2074) Add agreement_id to existing GOV.UK Pay request ([@irisfaraway](https://github.com/irisfaraway))

#### Committers: 1
- Iris Faraway ([@irisfaraway](https://github.com/irisfaraway))

## v1.55.0-rc.3 (2024-11-21)

#### :rocket: Enhancement
* [#2078](https://github.com/DEFRA/rod-licensing/pull/2078) Set-output removed from versioning script ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.55.0-rc.2 (2024-11-19)

#### :rocket: Enhancement
* `gafl-webapp-service`
* [#2077](https://github.com/DEFRA/rod-licensing/pull/2077) Change links for three rod licence ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.55.0-rc.1 (2024-11-19)

#### :rocket: Enhancement
* `gafl-webapp-service`
* [#2079](https://github.com/DEFRA/rod-licensing/pull/2079) Licence summary licence type capitals ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.55.0-rc.0 (2024-11-13)

#### :rocket: Enhancement
* `dynamics-lib`
* [#2072](https://github.com/DEFRA/rod-licensing/pull/2072) Create activity in CRM ([@nabeelamir-defra](https://github.com/nabeelamir-defra))

#### Committers: 1
- Nabeel Amir ([@nabeelamir-defra](https://github.com/nabeelamir-defra))




Expand Down
5 changes: 0 additions & 5 deletions docker/env/fulfilment_job.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ FULFILMENT_S3_BUCKET=fulfilment-audit
FULFILMENT_FILE_SIZE=5000

# FTP Settings
FULFILMENT_FTP_HOST=host.docker.internal
FULFILMENT_FTP_PORT=2222
FULFILMENT_FTP_PATH=/share/fulfilment
FULFILMENT_FTP_USERNAME=test_sftp_user
FULFILMENT_FTP_KEY_SECRET_ID=/dev/fsh/local/sftp/ssh_ed25519_host_key
FULFILMENT_SEND_UNENCRYPTED_FILE=true
FULFILMENT_PGP_PUBLIC_KEY_SECRET_ID=/dev/fsh/local/

Expand Down
1 change: 1 addition & 0 deletions docker/env/gafl_webapp.secrets.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
####################################################################################

GOV_PAY_APIKEY=<insert here>
GOV_PAY_RECURRING_APIKEY=<insert here>
SESSION_COOKIE_PASSWORD=<insert here>
ANALYTICS_PROPERTY_API=<insert here>
27 changes: 0 additions & 27 deletions docker/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,3 @@ services:
deploy:
restart_policy:
condition: on-failure

#######################################################
# Test SFTP server
#######################################################
ftp:
image: rod_licensing/ftp:${TAG:-latest}
build:
dockerfile: Dockerfile
context: ./resources/infrastructure/sftp
depends_on:
- localstack
ports:
- '2222:22'
volumes:
- ./volumes/sftp:/home/test_sftp_user/share
environment:
SFTP_USER: test_sftp_user
SFTP_FOLDERS: share/pocl;share/fulfilment
AWS_SECRETSMANAGER_ENDPOINT: http://host.docker.internal:4566
AWS_DEFAULT_REGION: eu-west-2
AWS_ACCESS_KEY_ID: local
AWS_SECRET_ACCESS_KEY: local
SSH_HOST_ED25519_SECRET_ID: /dev/fsh/local/sftp/ssh_ed25519_host_key
SSH_HOST_RSA_SECRET_ID: /dev/fsh/local/sftp/ssh_rsa_host_key
deploy:
restart_policy:
condition: on-failure
11 changes: 0 additions & 11 deletions docker/resources/infrastructure/sftp/Dockerfile

This file was deleted.

85 changes: 0 additions & 85 deletions docker/resources/infrastructure/sftp/files/entrypoint.sh

This file was deleted.

24 changes: 0 additions & 24 deletions docker/resources/infrastructure/sftp/files/sshd_config

This file was deleted.

1 change: 0 additions & 1 deletion docker/volumes/sftp/fulfilment/README.md

This file was deleted.

1 change: 0 additions & 1 deletion docker/volumes/sftp/pocl/README.md

This file was deleted.

1 change: 1 addition & 0 deletions packages/connectors-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Provides connectivity to the resources/infrastructure used in the rod licensing
| SALES_API_TIMEOUT_MS | Request timeout for the requests to the sales API | no | 20000 (20s) | | |
| GOV_PAY_API_URL | The GOV.UK Pay API base url | yes | | | |
| GOV_PAY_APIKEY | GOV pay access identifier | yes | | | |
| GOV_PAY_RECURRING_APIKEY | GOV pay access identifier for recurring payments | yes | | | |
| GOV_PAY_REQUEST_TIMEOUT_MS | Timeout in milliseconds for API requests | no | 10000 | | |
| GOV_PAY_RCP_API_URL | The GOV.UK Pay API url for agreements | yes | |

Expand Down
42 changes: 40 additions & 2 deletions packages/connectors-lib/src/__tests__/govuk-pay-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ const fetch = require('node-fetch')
process.env.GOV_PAY_API_URL = 'http://0.0.0.0/payment'
process.env.GOV_PAY_RCP_API_URL = 'http://0.0.0.0/agreement'
process.env.GOV_PAY_APIKEY = 'key'
process.env.GOV_PAY_RECURRING_APIKEY = 'recurringkey'

const headers = {
accept: 'application/json',
authorization: `Bearer ${process.env.GOV_PAY_APIKEY}`,
'content-type': 'application/json'
}

const recurringHeaders = {
accept: 'application/json',
authorization: `Bearer ${process.env.GOV_PAY_RECURRING_APIKEY}`,
'content-type': 'application/json'
}

describe('govuk-pay-api-connector', () => {
beforeEach(jest.clearAllMocks)

Expand Down Expand Up @@ -41,6 +48,17 @@ describe('govuk-pay-api-connector', () => {
})
expect(consoleErrorSpy).toHaveBeenCalled()
})

it('uses the correct API key if recurring arg is set to true', async () => {
fetch.mockReturnValue({ ok: true, status: 200 })
await expect(govUkPayApi.createPayment({ cost: 0 }, true)).resolves.toEqual({ ok: true, status: 200 })
expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/payment', {
body: JSON.stringify({ cost: 0 }),
headers: recurringHeaders,
method: 'post',
timeout: 10000
})
})
})

describe('fetchPaymentStatus', () => {
Expand All @@ -63,6 +81,16 @@ describe('govuk-pay-api-connector', () => {
expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/payment/123', { headers, method: 'get', timeout: 10000 })
expect(consoleErrorSpy).toHaveBeenCalled()
})

it('uses the correct API key if recurring arg is set to true', async () => {
fetch.mockReturnValue({ ok: true, status: 200, json: () => {} })
await expect(govUkPayApi.fetchPaymentStatus(123, true)).resolves.toEqual(expect.objectContaining({ ok: true, status: 200 }))
expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/payment/123', {
headers: recurringHeaders,
method: 'get',
timeout: 10000
})
})
})

describe('fetchPaymentEvents', () => {
Expand All @@ -80,6 +108,16 @@ describe('govuk-pay-api-connector', () => {
await expect(govUkPayApi.fetchPaymentEvents(123)).rejects.toEqual(Error('test event error'))
expect(consoleErrorSpy).toHaveBeenCalled()
})

it('uses the correct API key if recurring arg is set to true', async () => {
fetch.mockReturnValue({ ok: true, status: 200, json: () => {} })
await expect(govUkPayApi.fetchPaymentEvents(123, true)).resolves.toEqual(expect.objectContaining({ ok: true, status: 200 }))
expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/payment/123/events', {
headers: recurringHeaders,
method: 'get',
timeout: 10000
})
})
})

describe('createRecurringPayment', () => {
Expand All @@ -88,7 +126,7 @@ describe('govuk-pay-api-connector', () => {
await expect(govUkPayApi.createRecurringPayment({ cost: 0 })).resolves.toEqual({ ok: true, status: 200 })
expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/agreement', {
body: JSON.stringify({ cost: 0 }),
headers,
headers: recurringHeaders,
method: 'post',
timeout: 10000
})
Expand All @@ -102,7 +140,7 @@ describe('govuk-pay-api-connector', () => {
expect(govUkPayApi.createRecurringPayment({ reference: '123' })).rejects.toEqual(Error(''))
expect(fetch).toHaveBeenCalledWith('http://0.0.0.0/agreement', {
body: JSON.stringify({ reference: '123' }),
headers,
headers: recurringHeaders,
method: 'post',
timeout: 10000
})
Expand Down
Loading

0 comments on commit 85c51bf

Please sign in to comment.