From 6c7ca27d7c585aa35324ea9cd624234ff1f6f88b Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Tue, 17 Oct 2023 15:02:07 -0400 Subject: [PATCH 1/2] fix!: wrong access method type (http -> https) --- chord_drs/routes.py | 2 +- tests/test_routes.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chord_drs/routes.py b/chord_drs/routes.py index d16f7bf..e404cf3 100644 --- a/chord_drs/routes.py +++ b/chord_drs/routes.py @@ -193,7 +193,7 @@ def build_blob_json(drs_blob: DrsBlob, inside_container: bool = False) -> DRSObj # out-of-band method, or the object's contents are public. This # will depend on how the service is deployed. }, - "type": "http", + "type": "https", } access_methods: list[DRSAccessMethodDict] = [default_access_method] diff --git a/tests/test_routes.py b/tests/test_routes.py index 71780a6..dd485ba 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -26,8 +26,8 @@ def validate_object_fields(data, existing_id=None, with_internal_path=False): assert "size" in data assert "self_uri" in data - method_types = [method['type'] for method in data["access_methods"]] - assert "http" in method_types + method_types = [method["type"] for method in data["access_methods"]] + assert "https" in method_types if is_minio: assert "s3" in method_types elif is_local and with_internal_path: From b0a7b09855f9d716668a944b43054c58458ee8df Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Tue, 17 Oct 2023 15:08:42 -0400 Subject: [PATCH 2/2] chore: rename default_access_method to https_access_method --- chord_drs/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chord_drs/routes.py b/chord_drs/routes.py index e404cf3..6c1bdce 100644 --- a/chord_drs/routes.py +++ b/chord_drs/routes.py @@ -185,7 +185,7 @@ def build_blob_json(drs_blob: DrsBlob, inside_container: bool = False) -> DRSObj url_for("drs_service.object_download", object_id=drs_blob.id).lstrip("/") ) - default_access_method: DRSAccessMethodDict = { + https_access_method: DRSAccessMethodDict = { "access_url": { # url_for external was giving weird results - build the URL by hand instead using the internal url_for "url": blob_url, @@ -196,7 +196,7 @@ def build_blob_json(drs_blob: DrsBlob, inside_container: bool = False) -> DRSObj "type": "https", } - access_methods: list[DRSAccessMethodDict] = [default_access_method] + access_methods: list[DRSAccessMethodDict] = [https_access_method] if inside_container and data_source == DATA_SOURCE_LOCAL: access_methods.append({