From b9b98f15ceecba26f6bff30465c2b1534694fed9 Mon Sep 17 00:00:00 2001 From: kburke <209327+kburke@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:06:26 -0400 Subject: [PATCH 1/2] Add module resolution to Exception subclass usage. --- src/schema/schema_validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schema/schema_validators.py b/src/schema/schema_validators.py index a3c56492..9aa53118 100644 --- a/src/schema/schema_validators.py +++ b/src/schema/schema_validators.py @@ -906,12 +906,12 @@ def _validate_application_header(applications_allowed, request_headers): if not app_header: msg = f"Unable to proceed due to missing {SchemaConstants.HUBMAP_APP_HEADER} header from request" - raise MissingApplicationHeaderException(msg) + raise schema_errors.MissingApplicationHeaderException(msg) # Use lowercase for comparing the application header value against the yaml if app_header.lower() not in applications_allowed: msg = f"Unable to proceed due to invalid {SchemaConstants.HUBMAP_APP_HEADER} header value: {app_header}" - raise InvalidApplicationHeaderException(msg) + raise schema_errors.InvalidApplicationHeaderException(msg) """ Indicate if the entity meets a criteria to lock out modification updates From 45ad3010d33ab4b8c4808b411f58602a1ccd7fa9 Mon Sep 17 00:00:00 2001 From: kburke <209327+kburke@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:25:36 -0400 Subject: [PATCH 2/2] Introduce Ingest-UI as supported app for POST and PUT calls. --- src/schema/schema_constants.py | 1 + src/schema/schema_validators.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/schema/schema_constants.py b/src/schema/schema_constants.py index e3cfd1a5..acd160fc 100644 --- a/src/schema/schema_constants.py +++ b/src/schema/schema_constants.py @@ -6,6 +6,7 @@ class SchemaConstants(object): ENTITY_API_APP = 'entity-api' COMPONENT_DATASET = 'component-dataset' INGEST_PIPELINE_APP = 'ingest-pipeline' + INGEST_UI = 'ingest-ui' HUBMAP_APP_HEADER = 'X-Hubmap-Application' LOCKED_ENTITY_UPDATE_HEADER = 'X-HuBMAP-Update-Override' INTERNAL_TRIGGER = 'X-Internal-Trigger' diff --git a/src/schema/schema_validators.py b/src/schema/schema_validators.py index 9aa53118..802a47d9 100644 --- a/src/schema/schema_validators.py +++ b/src/schema/schema_validators.py @@ -41,6 +41,7 @@ def validate_application_header_before_entity_create(options_dict): applications_allowed = [ SchemaConstants.INGEST_API_APP, SchemaConstants.INGEST_PIPELINE_APP, + SchemaConstants.INGEST_UI, SchemaConstants.ENTITY_API_APP ] @@ -348,6 +349,7 @@ def validate_application_header_before_property_update(property_key, normalized_ applications_allowed = [ SchemaConstants.INGEST_API_APP, SchemaConstants.INGEST_PIPELINE_APP, + SchemaConstants.INGEST_UI, SchemaConstants.ENTITY_API_APP ]