Skip to content

Commit de46a5f

Browse files
eli 623 - nhse-product-id re-cased
1 parent 7118db0 commit de46a5f

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

infrastructure/stacks/api-layer/api_gateway.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ resource "aws_api_gateway_stage" "eligibility-signposting-api" {
6464
"caller": "$context.identity.caller",
6565
"httpMethod": "$context.httpMethod",
6666
"ip": "$context.identity.sourceIp",
67-
"nhse_product_id": "$context.request.header.nhse-product-id",
6867
"protocol": "$context.protocol",
6968
"requestId": "$context.requestId",
7069
"requestTime": "$context.requestTime",

src/eligibility_signposting_api/config/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
URL_PREFIX = "patient-check"
44
RULE_STOP_DEFAULT = False
55
NHS_NUMBER_HEADER = "nhs-login-nhs-number"
6-
CONSUMER_ID = "nhse-product-id" # "NHSE-Product-ID"
6+
CONSUMER_ID = "NHSE-Product-ID"
77
ALLOWED_CONDITIONS = Literal["COVID", "FLU", "MMR", "RSV"]

src/eligibility_signposting_api/logging/logs_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
from mangum.types import LambdaContext, LambdaEvent
77

8+
from eligibility_signposting_api.config.constants import CONSUMER_ID
9+
810
logger = logging.getLogger(__name__)
911

1012

@@ -20,7 +22,7 @@ def wrapper(event: LambdaEvent, context: LambdaContext) -> dict[str, Any] | None
2022
"x_request_id": headers.get("X-Request-ID"),
2123
"x_correlation_id": headers.get("X-Correlation-ID"),
2224
"gateway_request_id": gateway_request_id,
23-
"nhse_product_id": headers.get("nhse-product-id"),
25+
"nhse_product_id": headers.get(CONSUMER_ID),
2426
"nhsd_application_id": headers.get("nhsd-application-id"),
2527
},
2628
)

tests/integration/lambda/test_app_running_as_lambda.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def test_given_nhs_number_in_path_matches_with_nhs_number_in_headers_and_check_i
208208
"x_correlation_id": "x_correlation_id",
209209
"nhsd_end_user_organisation_ods": "nhsd_end_user_organisation_ods",
210210
"nhsd-application-id": "nhsd-application-id",
211-
"nhse-product-id": consumer_id,
211+
"NHSE-Product-ID": consumer_id,
212212
},
213213
params={"includeActions": "Y"},
214214
timeout=10,
@@ -458,7 +458,7 @@ def test_given_person_has_unique_status_for_different_conditions_with_audit( #
458458
"x_correlation_id": "x_correlation_id",
459459
"nhsd_end_user_organisation_ods": "nhsd_end_user_organisation_ods",
460460
"nhsd-application-id": "nhsd-application-id",
461-
"nhse-product-id": consumer_id,
461+
"NHSE-Product-ID": consumer_id,
462462
},
463463
params={"includeActions": "Y", "category": "VACCINATIONS", "conditions": "COVID,FLU,RSV"},
464464
timeout=10,
@@ -602,7 +602,7 @@ def test_no_active_iteration_returns_empty_processed_suggestions(
602602
"x_correlation_id": "x_correlation_id",
603603
"nhsd_end_user_organisation_ods": "nhsd_end_user_organisation_ods",
604604
"nhsd-application-id": "nhsd-application-id",
605-
"nhse-product-id": consumer_id,
605+
"NHSE-Product-ID": consumer_id,
606606
},
607607
params={"includeActions": "Y", "category": "VACCINATIONS", "conditions": "COVID,FLU,RSV"},
608608
timeout=10,

0 commit comments

Comments
 (0)