Skip to content

Commit 1784fdc

Browse files
committed
Merge branch 'main' of https://github.com/NHSDigital/nhs-notify-web-template-management into feature/CCM-10048_flakey-tests
2 parents 90873d2 + 5ac636a commit 1784fdc

31 files changed

+241
-101
lines changed

frontend/src/__tests__/utils/markdownit/__snapshots__/index.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`renderEmailMarkdown should only process email markdown rules 1`] = `
1212
<li>ordered list item 1</li>
1313
<li>ordered list item 2</li>
1414
</ol>
15-
<p><a href="https://www.nhs.uk/example">Read more</a></p>
15+
<p><a href="https://www.nhs.uk/example" target="_blank" rel="noopener noreferrer">Read more</a></p>
1616
<p>https://www.nhs.uk/example</p>
1717
<p>Before page break</p>
1818
<hr>
@@ -38,7 +38,7 @@ exports[`renderNHSAppMarkdown should only process nhs app markdown rules 1`] = `
3838
<li>ordered list item 1</li>
3939
<li>ordered list item 2</li>
4040
</ol>
41-
<p><a href="https://www.nhs.uk/example">Read more</a></p>
41+
<p><a href="https://www.nhs.uk/example" target="_blank" rel="noopener noreferrer">Read more</a></p>
4242
<p>https://www.nhs.uk/example</p>
4343
<p>Before page break
4444
***

frontend/src/utils/markdownit/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import { lineBreak } from './plugins/line-break';
44
export class MarkdownItWrapper extends MarkdownIt {
55
constructor() {
66
super('zero');
7+
8+
// rendered links should open in a new tab
9+
this.renderer.rules.link_open = (tokens, idx) => {
10+
const href = tokens[idx].attrGet('href');
11+
12+
return `<a href="${href}" target="_blank" rel="noopener noreferrer">`;
13+
};
714
}
815

916
/**

infrastructure/terraform/bin/terraform.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ readonly component_name=$(basename ${component_path});
403403
# verify terraform version matches .tool-versions
404404
echo ${PWD}
405405
tool_version=$(grep "terraform " .tool-versions | cut -d ' ' -f 2)
406-
asdf plugin-add terraform && asdf install terraform "${tool_version}"
406+
asdf plugin add terraform && asdf install terraform "${tool_version}"
407407
current_version=$(terraform --version | head -n 1 | cut -d 'v' -f 2)
408408

409409
if [ -z "${current_version}" ] || [ "${current_version}" != "${tool_version}" ]; then

infrastructure/terraform/components/acct/module_sandbox_kms.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,35 @@ data "aws_iam_policy_document" "kms" {
5454
]
5555
}
5656
}
57+
58+
statement {
59+
sid = "AllowLogDeliveryEncrypt"
60+
effect = "Allow"
61+
62+
principals {
63+
type = "Service"
64+
65+
identifiers = [
66+
"delivery.logs.amazonaws.com"
67+
]
68+
}
69+
70+
actions = [
71+
"kms:Decrypt",
72+
"kms:GenerateDataKey*",
73+
]
74+
75+
resources = [
76+
"*",
77+
]
78+
79+
condition {
80+
test = "StringLike"
81+
variable = "kms:EncryptionContext:SourceArn"
82+
83+
values = [
84+
"arn:aws:logs:${var.region}:${var.aws_account_id}:*",
85+
]
86+
}
87+
}
5788
}

infrastructure/terraform/components/app/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
1818
| <a name="input_aws_principal_org_id"></a> [aws\_principal\_org\_id](#input\_aws\_principal\_org\_id) | The AWS Org ID (numeric) | `string` | n/a | yes |
1919
| <a name="input_backup_report_recipient"></a> [backup\_report\_recipient](#input\_backup\_report\_recipient) | Primary recipient of the Backup reports | `string` | `""` | no |
20-
| <a name="input_backup_schedule_cron"></a> [backup\_schedule\_cron](#input\_backup\_schedule\_cron) | Defines the backup schedule in AWS Cron Expression format | `string` | `"cron(0 0/6 * * ? *)"` | no |
20+
| <a name="input_backup_schedule_cron"></a> [backup\_schedule\_cron](#input\_backup\_schedule\_cron) | Defines the backup schedule in AWS Cron Expression format | `string` | `"cron(0 2 * * ? *)"` | no |
2121
| <a name="input_branch_name"></a> [branch\_name](#input\_branch\_name) | The branch name to deploy | `string` | `"main"` | no |
2222
| <a name="input_cognito_user_pool_additional_callback_urls"></a> [cognito\_user\_pool\_additional\_callback\_urls](#input\_cognito\_user\_pool\_additional\_callback\_urls) | A list of additional callback\_urls for the cognito user pool | `list(string)` | `[]` | no |
2323
| <a name="input_commit_id"></a> [commit\_id](#input\_commit\_id) | The commit to deploy. Must be in the tree for branch\_name | `string` | `"HEAD"` | no |
@@ -50,11 +50,11 @@
5050
|------|--------|---------|
5151
| <a name="module_amplify_branch"></a> [amplify\_branch](#module\_amplify\_branch) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/amp_branch | v1.0.0 |
5252
| <a name="module_backend_api"></a> [backend\_api](#module\_backend\_api) | ../../modules/backend-api | n/a |
53-
| <a name="module_download_authorizer_lambda"></a> [download\_authorizer\_lambda](#module\_download\_authorizer\_lambda) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.2 |
53+
| <a name="module_download_authorizer_lambda"></a> [download\_authorizer\_lambda](#module\_download\_authorizer\_lambda) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.13 |
5454
| <a name="module_eventpub"></a> [eventpub](#module\_eventpub) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/eventpub | v1.0.13 |
5555
| <a name="module_kms"></a> [kms](#module\_kms) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms | v1.0.8 |
5656
| <a name="module_kms_us_east_1"></a> [kms\_us\_east\_1](#module\_kms\_us\_east\_1) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms | v1.0.8 |
57-
| <a name="module_nhse_backup_vault"></a> [nhse\_backup\_vault](#module\_nhse\_backup\_vault) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source | v1.0.8 |
57+
| <a name="module_nhse_backup_vault"></a> [nhse\_backup\_vault](#module\_nhse\_backup\_vault) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source | v2.0.12 |
5858
| <a name="module_s3bucket_cf_logs"></a> [s3bucket\_cf\_logs](#module\_s3bucket\_cf\_logs) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.2 |
5959
## Outputs
6060

infrastructure/terraform/components/app/module_download_authorizer_lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "download_authorizer_lambda" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda?ref=v2.0.2"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda?ref=v2.0.13"
33

44
providers = {
55
aws = aws.us-east-1

infrastructure/terraform/components/app/module_kms.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,35 @@ data "aws_iam_policy_document" "kms" {
7575
]
7676
}
7777
}
78+
79+
statement {
80+
sid = "AllowLogDeliveryEncrypt"
81+
effect = "Allow"
82+
83+
principals {
84+
type = "Service"
85+
86+
identifiers = [
87+
"delivery.logs.amazonaws.com"
88+
]
89+
}
90+
91+
actions = [
92+
"kms:Decrypt",
93+
"kms:GenerateDataKey*",
94+
]
95+
96+
resources = [
97+
"*",
98+
]
99+
100+
condition {
101+
test = "StringLike"
102+
variable = "kms:EncryptionContext:SourceArn"
103+
104+
values = [
105+
"arn:aws:logs:${var.region}:${var.aws_account_id}:*",
106+
]
107+
}
108+
}
78109
}

infrastructure/terraform/components/app/module_nhse_backup_vault.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module "nhse_backup_vault" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source?ref=v1.0.8"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source?ref=v2.0.12"
33
count = var.destination_vault_arn != null ? 1 : 0
44

5-
component = var.component
6-
environment = var.environment
7-
project = var.project
5+
component = var.component
6+
environment = var.environment
7+
project = var.project
8+
89
backup_copy_vault_account_id = data.aws_arn.destination_vault_arn[0].account
910
backup_copy_vault_arn = data.aws_arn.destination_vault_arn[0].arn
1011

infrastructure/terraform/components/app/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ variable "destination_vault_arn" {
139139
variable "backup_schedule_cron" {
140140
type = string
141141
description = "Defines the backup schedule in AWS Cron Expression format"
142-
default = "cron(0 0/6 * * ? *)"
142+
default = "cron(0 2 * * ? *)"
143143
}
144144

145145
variable "retention_period" {

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ module "backend_api" {
2121
letter_suppliers = var.letter_suppliers
2222

2323
kms_key_arn = data.aws_kms_key.sandbox.arn
24-
dynamodb_kms_key_arn = data.aws_kms_key.sandbox.arn
2524

2625
test_environment_mock_guardduty_event_source = "test.guardduty"
2726

2827
send_to_firehose = false
28+
29+
enable_event_stream = true
2930
}

0 commit comments

Comments
 (0)