Skip to content

Commit d4a084d

Browse files
committed
check if file_key as extended_attribute
1 parent a7470c3 commit d4a084d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lambdas/filenameprocessor/src/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
VACCINE_TYPE_TO_DISEASES_HASH_KEY = "vacc_to_diseases"
1919
ODS_CODE_TO_SUPPLIER_SYSTEM_HASH_KEY = "ods_code_to_supplier"
20+
EXTENDED_ATTRIBUTES_PREFIXES = "Vaccination_Extended_Attributes"
2021

2122
ERROR_TYPE_TO_STATUS_CODE_MAP = {
2223
VaccineTypePermissionsError: 403,

lambdas/filenameprocessor/src/file_name_processor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from common.models.errors import UnhandledAuditTableError
1717
from constants import (
1818
ERROR_TYPE_TO_STATUS_CODE_MAP,
19+
EXTENDED_ATTRIBUTES_PREFIXES,
1920
SOURCE_BUCKET_NAME,
2021
FileNotProcessedReason,
2122
FileStatus,
@@ -76,9 +77,11 @@ def handle_record(record) -> dict:
7677
message_id = str(uuid4())
7778
s3_response = get_s3_client().get_object(Bucket=bucket_name, Key=file_key)
7879
created_at_formatted_string, expiry_timestamp = get_creation_and_expiry_times(s3_response)
79-
80-
vaccine_type, supplier = validate_file_key(file_key)
81-
permissions = validate_vaccine_type_permissions(vaccine_type=vaccine_type, supplier=supplier)
80+
if file_key.startswith(tuple(EXTENDED_ATTRIBUTES_PREFIXES)):
81+
pass
82+
else:
83+
vaccine_type, supplier = validate_file_key(file_key)
84+
permissions = validate_vaccine_type_permissions(vaccine_type=vaccine_type, supplier=supplier)
8285

8386
queue_name = f"{supplier}_{vaccine_type}"
8487
upsert_audit_table(

0 commit comments

Comments
 (0)