diff --git a/lambdas/mns_publisher/src/process_records.py b/lambdas/mns_publisher/src/process_records.py index e55924d70..19792b7f3 100644 --- a/lambdas/mns_publisher/src/process_records.py +++ b/lambdas/mns_publisher/src/process_records.py @@ -1,6 +1,5 @@ import json import os -from typing import Tuple from aws_lambda_typing.events.sqs import SQSMessage @@ -68,7 +67,7 @@ def process_record(record: SQSMessage, mns_service: MnsService | MockMnsService) logger.info("Successfully created MNS notification", extra={"mns_notification_id": notification_id}) -def extract_trace_ids(record: SQSMessage) -> Tuple[str, str | None]: +def extract_trace_ids(record: SQSMessage) -> tuple[str, str | None]: """ Extract identifiers for tracing from SQS record. Returns: Tuple of (message_id, immunisation_id) diff --git a/lambdas/mns_publisher/tests/test_utils.py b/lambdas/mns_publisher/tests/test_utils.py index 4c6a71c15..1783681ae 100644 --- a/lambdas/mns_publisher/tests/test_utils.py +++ b/lambdas/mns_publisher/tests/test_utils.py @@ -23,7 +23,7 @@ def load_sample_sqs_event() -> dict: Expects: lambdas/mns_publisher/tests/sqs_event.json """ sample_event_path = Path(__file__).parent / "sample_data" / "sqs_event.json" - with open(sample_event_path, "r") as f: + with open(sample_event_path) as f: raw_event = json.load(f) if isinstance(raw_event.get("body"), dict): diff --git a/lambdas/shared/src/common/api_clients/authentication.py b/lambdas/shared/src/common/api_clients/authentication.py index 396d41c19..cea6107d1 100644 --- a/lambdas/shared/src/common/api_clients/authentication.py +++ b/lambdas/shared/src/common/api_clients/authentication.py @@ -26,7 +26,7 @@ def __init__(self, service: Service, secret_manager_client, environment, cache: self.expiry = 30 self.secret_name = ( - f"imms/pds/{environment}/jwt-secrets" + f"imms/outbound/{environment}/jwt-secrets" if service == Service.PDS else f"imms/immunization/{environment}/jwt-secrets" ) diff --git a/lambdas/shared/src/common/get_service_url.py b/lambdas/shared/src/common/get_service_url.py index 9188c0750..212340e0b 100644 --- a/lambdas/shared/src/common/get_service_url.py +++ b/lambdas/shared/src/common/get_service_url.py @@ -1,9 +1,7 @@ -from typing import Optional - from common.constants import DEFAULT_BASE_PATH, PR_ENV_PREFIX -def get_service_url(service_env: Optional[str], service_base_path: Optional[str]) -> str: +def get_service_url(service_env: str | None, service_base_path: str | None) -> str: """Sets the service URL based on service parameters derived from env vars. PR environments use internal-dev while we also default to this environment. The only other exceptions are preprod which maps to the Apigee int environment and prod which does not have a subdomain.""" @@ -22,5 +20,5 @@ def get_service_url(service_env: Optional[str], service_base_path: Optional[str] return f"https://{subdomain}api.service.nhs.uk/{service_base_path}" -def is_pr_env(service_env: Optional[str]) -> bool: +def is_pr_env(service_env: str | None) -> bool: return service_env is not None and service_env.startswith(PR_ENV_PREFIX)