Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export default defineConfig([
project: [
"frontend/tsconfig.json",
"lambdas/*/tsconfig.json",
"tests/integration/tsconfig.json",
"tests/performance/tsconfig.json",
"tests/test-support/tsconfig.json",
"tests/test-team/tsconfig.json",
"utils/*/tsconfig.json",
],
Expand Down Expand Up @@ -197,7 +200,7 @@ export default defineConfig([
},
},
{
files: ["**/utils/**", "tests/test-team/**", "lambdas/**/src/**"],
files: ["**/utils/**", "tests/test-team/**", "tests/performance/helpers/**", "lambdas/**/src/**"],
rules: {
"import-x/prefer-default-export": 0,
},
Expand All @@ -211,19 +214,14 @@ export default defineConfig([
},
},
{
// Files inside helpers/ are loaded transitively by globalSetup/globalTeardown which run
// outside Jest's module system, so moduleNameMapper does not apply — relative imports only
files: ["tests/integration/helpers/**"],
rules: {
"no-relative-import-paths/no-relative-import-paths": 0,
},
},
{
// globalSetup/globalTeardown run outside Jest's module system so moduleNameMapper
// does not apply — relative imports are the only way to reach local helpers
// helpers/ files use relative imports between each other; test files import
// directly from local helpers using relative paths
files: [
"tests/integration/jest.global-setup.ts",
"tests/integration/jest.global-teardown.ts",
"tests/integration/helpers/**",
"tests/integration/*.test.ts",
"tests/performance/helpers/**",
"tests/performance/*.test.ts",
"tests/test-support/helpers/**",
],
rules: {
"no-relative-import-paths/no-relative-import-paths": 0,
Expand Down Expand Up @@ -273,6 +271,12 @@ export default defineConfig([
"import-x/first": "off",
},
},
{
files: ["tests/performance/**/*.ts"],
rules: {
"no-console": "off",
},
},

// misc rule overrides
{
Expand Down
11 changes: 6 additions & 5 deletions infrastructure/terraform/components/callbacks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | A map of default tags to apply to all taggable resources within the component | `map(string)` | `{}` | no |
| <a name="input_deploy_mock_webhook"></a> [deploy\_mock\_webhook](#input\_deploy\_mock\_webhook) | Flag to deploy mock webhook lambda for integration testing (test/dev environments only) | `bool` | `false` | no |
| <a name="input_enable_event_anomaly_detection"></a> [enable\_event\_anomaly\_detection](#input\_enable\_event\_anomaly\_detection) | Enable CloudWatch anomaly detection alarm for inbound event queue message reception | `bool` | `true` | no |
| <a name="input_enable_xray_tracing"></a> [enable\_xray\_tracing](#input\_enable\_xray\_tracing) | Enable AWS X-Ray active tracing for Lambda functions | `bool` | `false` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
| <a name="input_event_anomaly_band_width"></a> [event\_anomaly\_band\_width](#input\_event\_anomaly\_band\_width) | The width of the anomaly detection band. Higher values (e.g. 4-6) reduce sensitivity and noise, lower values (e.g. 2-3) increase sensitivity. Recommended: 2-4. | `number` | `3` | no |
| <a name="input_event_anomaly_evaluation_periods"></a> [event\_anomaly\_evaluation\_periods](#input\_event\_anomaly\_evaluation\_periods) | Number of evaluation periods for the anomaly alarm. Each period is defined by event\_anomaly\_period. | `number` | `2` | no |
Expand All @@ -43,12 +44,12 @@

| Name | Source | Version |
|------|--------|---------|
| <a name="module_client_config_bucket"></a> [client\_config\_bucket](#module\_client\_config\_bucket) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-s3bucket.zip | n/a |
| <a name="module_client_config_bucket"></a> [client\_config\_bucket](#module\_client\_config\_bucket) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-s3bucket.zip | n/a |
| <a name="module_client_destination"></a> [client\_destination](#module\_client\_destination) | ../../modules/client-destination | n/a |
| <a name="module_client_transform_filter_lambda"></a> [client\_transform\_filter\_lambda](#module\_client\_transform\_filter\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-lambda.zip | n/a |
| <a name="module_kms"></a> [kms](#module\_kms) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-kms.zip | n/a |
| <a name="module_mock_webhook_lambda"></a> [mock\_webhook\_lambda](#module\_mock\_webhook\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-lambda.zip | n/a |
| <a name="module_sqs_inbound_event"></a> [sqs\_inbound\_event](#module\_sqs\_inbound\_event) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-sqs.zip | n/a |
| <a name="module_client_transform_filter_lambda"></a> [client\_transform\_filter\_lambda](#module\_client\_transform\_filter\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-lambda.zip | n/a |
| <a name="module_kms"></a> [kms](#module\_kms) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-kms.zip | n/a |
| <a name="module_mock_webhook_lambda"></a> [mock\_webhook\_lambda](#module\_mock\_webhook\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-lambda.zip | n/a |
| <a name="module_sqs_inbound_event"></a> [sqs\_inbound\_event](#module\_sqs\_inbound\_event) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-sqs.zip | n/a |
## Outputs

| Name | Description |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "kms" {
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-kms.zip"
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-kms.zip"

aws_account_id = var.aws_account_id
component = var.component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "mock_webhook_lambda" {
count = var.deploy_mock_webhook ? 1 : 0
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-lambda.zip"
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-lambda.zip"

function_name = "mock-webhook"
description = "Mock webhook endpoint for integration testing - logs received callbacks to CloudWatch"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "sqs_inbound_event" {
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-sqs.zip"
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-sqs.zip"

aws_account_id = var.aws_account_id
component = var.component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "client_transform_filter_lambda" {
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-lambda.zip"
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-lambda.zip"

function_name = "client-transform-filter"
description = "Lambda function that transforms and filters events coming to through the eventpipe"
Expand Down Expand Up @@ -30,6 +30,7 @@ module "client_transform_filter_lambda" {

force_lambda_code_deploy = var.force_lambda_code_deploy
enable_lambda_insights = false
enable_xray_tracing = var.enable_xray_tracing

log_destination_arn = local.log_destination_arn
log_subscription_role_arn = local.acct.log_subscription_role_arn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "client_config_bucket" {
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-s3bucket.zip"
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-s3bucket.zip"

name = "subscription-config"

Expand Down
6 changes: 6 additions & 0 deletions infrastructure/terraform/components/callbacks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ variable "deploy_mock_webhook" {
default = false
}

variable "enable_xray_tracing" {
type = bool
description = "Enable AWS X-Ray active tracing for Lambda functions"
default = false
}

variable "message_root_uri" {
type = string
description = "The root URI used for constructing message links in callback payloads"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ No requirements.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_target_dlq"></a> [target\_dlq](#module\_target\_dlq) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-sqs.zip | n/a |
| <a name="module_target_dlq"></a> [target\_dlq](#module\_target\_dlq) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-sqs.zip | n/a |
## Outputs

No outputs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "target_dlq" {
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-sqs.zip"
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-sqs.zip"

aws_account_id = var.aws_account_id
component = var.component
Expand Down
45 changes: 42 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"src/models",
"lambdas/mock-webhook-lambda",
"tests/integration",
"tests/performance",
"tests/test-support",
"tools/client-subscriptions-management"
]
}
2 changes: 1 addition & 1 deletion scripts/config/sonar-scanner.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ sonar.qualitygate.wait=true
sonar.sourceEncoding=UTF-8
sonar.terraform.provider.aws.version=5.54.1
sonar.cpd.exclusions=**.test.*, src/models/**
sonar.coverage.exclusions=tests/**, lambdas/**/src/__tests__/**, src/**/src/__tests__/**, src/models/**, scripts/**/src/__tests__/**, tools/**/src/__tests__/**, **/jest.config.*
sonar.coverage.exclusions=tests/test-support/**, tests/**, lambdas/**/src/__tests__/**, src/**/src/__tests__/**, src/models/**, scripts/**/src/__tests__/**, tools/**/src/__tests__/**, **/jest.config.*
sonar.javascript.lcov.reportPaths=lcov.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ajv
auditability
[A-Z]+s
Bitwarden
bot
[Cc]onfig
Expand Down Expand Up @@ -33,6 +32,7 @@ repo
[Rr]unbook
sed
Syft
teardown
Terraform
toolchain
Trufflehog
6 changes: 6 additions & 0 deletions src/logger/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import pino from "pino";
import {
LogContext,
Logger,
REDACT_PATHS,
extractCorrelationId,
logLifecycleEvent,
logger,
Expand Down Expand Up @@ -33,6 +34,7 @@ const mockLoggerMethods = pino() as jest.Mocked<ReturnType<typeof pino>>;
type PinoConfig = {
formatters: { level: (label: string) => { level: string } };
timestamp: () => string;
redact: string[];
};
const capturedPinoConfig = (pino as unknown as jest.Mock).mock
.calls[0][0] as PinoConfig;
Expand Down Expand Up @@ -297,6 +299,10 @@ describe("pino configuration", () => {
const result = capturedPinoConfig.timestamp();
expect(result).toMatch(/^,"timestamp":"\d{4}-\d{2}-\d{2}T/);
});

it("should configure pino with redact paths", () => {
expect(capturedPinoConfig.redact).toEqual(REDACT_PATHS);
});
});

describe("logLifecycleEvent", () => {
Expand Down
Loading
Loading