Skip to content

Commit 8acf198

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/CCM-13188-contract-test
2 parents 09e7f68 + 1d8701d commit 8acf198

File tree

94 files changed

+3182
-2331
lines changed

Some content is hidden

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

94 files changed

+3182
-2331
lines changed

.github/workflows/pr_closed.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ jobs:
6161
--targetEnvironment "main" \
6262
--targetAccountGroup "nhs-notify-supplier-api-dev" \
6363
--targetComponent "${{ matrix.component }}" \
64-
--terraformAction "apply"
64+
--terraformAction "apply" \
65+
--overrideProjectName "nhs" \
66+
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
6567
6668
check-event-schemas-version-change:
6769
name: Check for event schemas package version change

.github/workflows/release_created.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ jobs:
3737
--targetEnvironment "main" \
3838
--targetAccountGroup "nhs-notify-supplier-api-nonprod" \
3939
--targetComponent "${{ matrix.component }}" \
40-
--terraformAction "apply"
40+
--terraformAction "apply" \
41+
--overrideProjectName "nhs" \
42+
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ publish-oas:
4545
$(MAKE) copy-examples
4646
npm run publish-oas
4747

48+
set-authorization: guard-APIM_ENV
49+
@ AUTHORIZATION=authorization-$$APIM_ENV.yml \
50+
envsubst '$${AUTHORIZATION}' \
51+
< specification/api/components/parameters/authorization/authorization-template.yml > specification/api/components/parameters/authorization/authorization.yml
52+
4853
set-target: guard-APIM_ENV
4954
@ TARGET=target-$$APIM_ENV.yml \
5055
envsubst '$${TARGET}' \
@@ -64,6 +69,7 @@ set-security: guard-APIM_ENV
6469
< specification/api/components/security-schemes/security-schemes-template.yml > specification/api/components/security-schemes/security-schemes.yml
6570

6671
construct-spec: guard-APIM_ENV
72+
$(MAKE) set-authorization APIM_ENV=$$APIM_ENV
6773
$(MAKE) set-target APIM_ENV=$$APIM_ENV
6874
$(MAKE) set-access APIM_ENV=$$APIM_ENV
6975
$(MAKE) set-security APIM_ENV=$$APIM_ENV

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0-${yyyy}${mm}${dd}.${HH}${MM}${SS}+${hash}
1+
1.0.1-${yyyy}${mm}${dd}.${HH}${MM}${SS}+${hash}

eslint.config.mjs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default defineConfig([
8080
eslintImportResolverTypescript.createTypeScriptImportResolver({
8181
project: [
8282
'lambdas/*/tsconfig.json',
83-
'tests/test-team/tsconfig.json',
83+
'tests/tsconfig.json',
8484
'internal/*/tsconfig.json',
8585
],
8686
}),
@@ -167,7 +167,7 @@ export default defineConfig([
167167
rules: { 'import-x/no-unresolved': 0 },
168168
},
169169
{
170-
files: ['tests/test-team/**'],
170+
files: ['tests/**'],
171171
rules: {
172172
'import-x/no-extraneous-dependencies': [
173173
2,
@@ -176,7 +176,7 @@ export default defineConfig([
176176
},
177177
},
178178
{
179-
files: ['**/utils/**', 'tests/test-team/**'],
179+
files: ['**/utils/**', 'tests/**'],
180180
rules: { 'import-x/prefer-default-export': 0 },
181181
},
182182
{
@@ -221,6 +221,20 @@ export default defineConfig([
221221
},
222222
},
223223

224+
// No use before define relaxations
225+
{
226+
rules: {
227+
"no-use-before-define": "off",
228+
"@typescript-eslint/no-use-before-define": [ "error", {"functions": false}]
229+
}
230+
},
231+
232+
// Lambda specific relaxations
233+
{
234+
files: ['lambdas/**'],
235+
rules: { 'import-x/prefer-default-export': 1 },
236+
},
237+
224238
// misc rule overrides
225239
{
226240
rules: {

infrastructure/terraform/bin/terraform.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ readonly backend_config="terraform {
599599
region = \"${region}\"
600600
bucket = \"${bucket}\"
601601
key = \"${backend_key}\"
602-
dynamodb_table = \"${bucket}\"
603602
use_lockfile = true
604603
}
605604
}";

infrastructure/terraform/components/api/event_source_mapping_status_updates_to_handler.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "aws_lambda_event_source_mapping" "status_updates_sqs_to_status_update_
66
scaling_config { maximum_concurrency = 10 }
77

88
depends_on = [
9-
module.letter_status_updates_queue, # ensures queue exists
10-
module.letter_status_update # ensures update handler exists
9+
module.letter_status_updates_queue, # ensures queue exists
10+
module.letter_status_update # ensures update handler exists
1111
]
1212
}

infrastructure/terraform/components/api/locals.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ locals {
55
root_domain_nameservers = local.acct.route53_zone_nameservers["supplier-api"]
66

77
openapi_spec = templatefile("${path.module}/resources/spec.tmpl.json", {
8-
APIG_EXECUTION_ROLE_ARN = aws_iam_role.api_gateway_execution_role.arn
9-
AWS_REGION = var.region
10-
AUTHORIZER_LAMBDA_ARN = module.authorizer_lambda.function_arn
11-
GET_LETTER_LAMBDA_ARN = module.get_letter.function_arn
12-
GET_LETTERS_LAMBDA_ARN = module.get_letters.function_arn
13-
GET_LETTER_DATA_LAMBDA_ARN = module.get_letter_data.function_arn
14-
GET_STATUS_LAMBDA_ARN = module.get_status.function_arn
15-
PATCH_LETTER_LAMBDA_ARN = module.patch_letter.function_arn
16-
POST_LETTERS_LAMBDA_ARN = module.post_letters.function_arn
17-
POST_MI_LAMBDA_ARN = module.post_mi.function_arn
8+
APIG_EXECUTION_ROLE_ARN = aws_iam_role.api_gateway_execution_role.arn
9+
AWS_REGION = var.region
10+
AUTHORIZER_LAMBDA_ARN = module.authorizer_lambda.function_arn
11+
GET_LETTER_LAMBDA_ARN = module.get_letter.function_arn
12+
GET_LETTERS_LAMBDA_ARN = module.get_letters.function_arn
13+
GET_LETTER_DATA_LAMBDA_ARN = module.get_letter_data.function_arn
14+
GET_STATUS_LAMBDA_ARN = module.get_status.function_arn
15+
PATCH_LETTER_LAMBDA_ARN = module.patch_letter.function_arn
16+
POST_LETTERS_LAMBDA_ARN = module.post_letters.function_arn
17+
POST_MI_LAMBDA_ARN = module.post_mi.function_arn
1818
})
1919

2020
destination_arn = "arn:aws:logs:${var.region}:${var.shared_infra_account_id}:destination:nhs-main-obs-firehose-logs"
@@ -23,7 +23,7 @@ locals {
2323
LETTERS_TABLE_NAME = aws_dynamodb_table.letters.name,
2424
MI_TABLE_NAME = aws_dynamodb_table.mi.name,
2525
LETTER_TTL_HOURS = 12960, # 18 months * 30 days * 24 hours
26-
MI_TTL_HOURS = 2160 # 90 days * 24 hours
26+
MI_TTL_HOURS = 2160 # 90 days * 24 hours
2727
SUPPLIER_ID_HEADER = "nhsd-supplier-id",
2828
APIM_CORRELATION_HEADER = "nhsd-correlation-id",
2929
DOWNLOAD_URL_TTL_SECONDS = 60

infrastructure/terraform/components/api/module_authorizer_lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module "authorizer_lambda" {
3838
lambda_env_vars = {
3939
CLOUDWATCH_NAMESPACE = "/aws/api-gateway/supplier/alarms",
4040
CLIENT_CERTIFICATE_EXPIRATION_ALERT_DAYS = 14,
41-
APIM_SUPPLIER_ID_HEADER = "NHSD-Supplier-ID",
41+
APIM_SUPPLIER_ID_HEADER = "NHSD-Supplier-ID",
4242
SUPPLIERS_TABLE_NAME = aws_dynamodb_table.suppliers.name
4343
}
4444
}

infrastructure/terraform/components/api/module_lambda_get_letter_data.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ data "aws_iam_policy_document" "get_letter_data_lambda" {
6969
}
7070

7171
statement {
72-
sid = "S3GetObjectForPresign"
73-
actions = [
72+
sid = "S3GetObjectForPresign"
73+
actions = [
7474
"s3:GetObject",
75-
"s3:ListBucket"] # allows 404 response instead of 403 if object missing
75+
"s3:ListBucket"] # allows 404 response instead of 403 if object missing
7676
resources = ["${module.s3bucket_test_letters.arn}/*"]
7777
}
7878
}

0 commit comments

Comments
 (0)