Skip to content

Commit a93af27

Browse files
Merge pull request #629 from govuk-one-login/OJ-3197
OJ-3197 - Create NINo check handler
2 parents bdf3dd5 + 4d6ce43 commit a93af27

72 files changed

Lines changed: 7810 additions & 22750 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-pr.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,21 @@ jobs:
8181
stack-name: ${{ needs.deploy.outputs.stack-name }}
8282
aws-region: ${{ needs.deploy.outputs.aws-region }}
8383

84-
eventbridge-nino-check-tests:
84+
eventbridge-nino-check-tests-sfn:
8585
name: Run tests
86-
needs: [deploy, eventbridge-abandon-tests ]
87-
uses: ./.github/workflows/run-evn-nino-tests.yml
86+
needs: [deploy, eventbridge-abandon-tests]
87+
uses: ./.github/workflows/run-evn-nino-tests-sfn.yml
88+
permissions:
89+
id-token: write
90+
contents: read
91+
with:
92+
stack-name: ${{ needs.deploy.outputs.stack-name }}
93+
aws-region: ${{ needs.deploy.outputs.aws-region }}
94+
95+
eventbridge-nino-check-tests-lambda:
96+
name: Run tests
97+
needs: [deploy, eventbridge-nino-check-tests-sfn]
98+
uses: ./.github/workflows/run-evn-nino-tests-lambda.yml
8899
permissions:
89100
id-token: write
90101
contents: read
@@ -94,7 +105,7 @@ jobs:
94105

95106
eventbridge-issue-credential-check-tests:
96107
name: Run tests
97-
needs: [deploy, eventbridge-nino-check-tests ]
108+
needs: [deploy, eventbridge-nino-check-tests-lambda]
98109
uses: ./.github/workflows/run-evn-cred-tests.yml
99110
permissions:
100111
id-token: write
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lambda AWS tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
stack-name: { required: true, type: string }
7+
aws-region: { required: true, type: string }
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
13+
concurrency:
14+
group: evn-nino-tests-lambda-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
run-tests:
19+
# "Run tests / EVN - NINO" is configured as a required test job on the repo, so the name must remain the same
20+
name: EVN - NINO
21+
timeout-minutes: 15
22+
runs-on: ubuntu-latest
23+
environment: development
24+
steps:
25+
- name: Assume AWS Role
26+
uses: aws-actions/configure-aws-credentials@v4
27+
with:
28+
role-to-assume: ${{ vars.DEPLOYMENT_ROLE_ARN }}
29+
aws-region: ${{ inputs.aws-region }}
30+
31+
- name: Run tests
32+
uses: govuk-one-login/github-actions/node/run-script@e6b6ed890b35904e1be79f7f35ffec983fa4d9db
33+
env:
34+
STACK_NAME: ${{ inputs.stack-name }}
35+
AWS_REGION: ${{ inputs.aws-region }}
36+
with:
37+
working-directory: integration-tests
38+
script: npm run test:evn:nino:lambda -- --config jest.config.ci.ts

.github/workflows/run-evn-nino-tests.yml renamed to .github/workflows/run-evn-nino-tests-sfn.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,16 @@ permissions:
1111
contents: read
1212

1313
concurrency:
14-
group: evn-nino-tests-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
14+
group: evn-nino-tests-sfn-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
1515
cancel-in-progress: true
1616

1717
jobs:
1818
run-tests:
19-
name: EVN - NINO
19+
name: EVN - NINO SFN
2020
timeout-minutes: 15
2121
runs-on: ubuntu-latest
2222
environment: development
2323
steps:
24-
- name: Pull repository
25-
uses: actions/checkout@v4
26-
27-
- name: Install Node
28-
uses: actions/setup-node@v4
29-
with:
30-
cache: npm
31-
32-
- name: Install dependencies
33-
run: npm ci --include-workspace-root
34-
3524
- name: Assume AWS Role
3625
uses: aws-actions/configure-aws-credentials@v4
3726
with:
@@ -45,4 +34,4 @@ jobs:
4534
AWS_REGION: ${{ inputs.aws-region }}
4635
with:
4736
working-directory: integration-tests
48-
script: npm run test:evn:nino -- --config jest.config.ci.ts
37+
script: npm run test:evn:nino:sfn -- --config jest.config.ci.ts

infrastructure/private-api.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,36 @@ paths:
166166
#set($context.responseOverride.status = 200)
167167
#end
168168
$output.body
169+
/check-test:
170+
post:
171+
summary: "IP address of the client."
172+
parameters:
173+
- $ref: "#/components/parameters/SessionHeader"
174+
- $ref: "#/components/parameters/AuditHeader"
175+
requestBody:
176+
content:
177+
application/json:
178+
schema:
179+
$ref: "#/components/schemas/Nino"
180+
required: true
181+
x-amazon-apigateway-request-validator: "Validate both"
182+
responses:
183+
"200":
184+
description: OK
185+
"400":
186+
description: Bad Request
187+
"500":
188+
description: Internal Server Error
189+
x-amazon-apigateway-integration:
190+
httpMethod: "POST"
191+
uri:
192+
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${NinoCheckFunction.Arn}:live/invocations
193+
responses:
194+
default:
195+
statusCode: "200"
196+
passthroughBehavior: "when_no_match"
197+
contentHandling: "CONVERT_TO_TEXT"
198+
type: "aws_proxy"
169199
/abandon:
170200
post:
171201
summary: "IP address of the client."

0 commit comments

Comments
 (0)