Skip to content

Commit

Permalink
Merge pull request #98 from bento-platform/chore/compliant-drs-uris
Browse files Browse the repository at this point in the history
chore!: switch to generating spec-compliant DRS URIs
  • Loading branch information
davidlougheed authored Apr 10, 2024
2 parents 0920edd + b37df29 commit 3234221
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
7 changes: 3 additions & 4 deletions chord_drs/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ def range_not_satisfiable_log_mark(description: str, length: int) -> RequestedRa
return RequestedRangeNotSatisfiable(description=description, length=length)


def get_drs_base_path() -> str:
parsed_service_url = urlparse(current_app.config["SERVICE_BASE_URL"])
return f"{parsed_service_url.netloc}{parsed_service_url.path}"
def get_drs_host() -> str:
return urlparse(current_app.config["SERVICE_BASE_URL"]).netloc


def create_drs_uri(object_id: str) -> str:
return f"drs://{get_drs_base_path()}/{object_id}"
return f"drs://{get_drs_host()}/{object_id}"


def build_contents(bundle: DrsBundle, expand: bool) -> list[DRSContentsDict]:
Expand Down
42 changes: 21 additions & 21 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "chord-drs"
version = "0.15.3"
version = "0.16.0"
description = "An implementation of a data repository system (as per GA4GH's specs) for the Bento platform."
authors = ["David Lougheed <[email protected]>"]
license = "LGPL-3.0"
Expand Down

0 comments on commit 3234221

Please sign in to comment.