Skip to content

Commit

Permalink
Merge pull request #70 from bento-platform/fix/access-method
Browse files Browse the repository at this point in the history
fix!: wrong access method type (http -> https)
  • Loading branch information
davidlougheed authored Oct 17, 2023
2 parents 3390508 + b0a7b09 commit b1b44cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions chord_drs/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,18 @@ 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,
# No headers --> auth will have to be obtained via some
# 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]
access_methods: list[DRSAccessMethodDict] = [https_access_method]

if inside_container and data_source == DATA_SOURCE_LOCAL:
access_methods.append({
Expand Down
4 changes: 2 additions & 2 deletions tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b1b44cc

Please sign in to comment.