Skip to content

Commit

Permalink
add ga4gh_passport_v1 scope for htsget
Browse files Browse the repository at this point in the history
  • Loading branch information
KrKOo committed May 29, 2024
1 parent a5dad6b commit b894fe2
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions snakemake_executor_plugin_auth_tes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ def __post_init__(self):

exchange_result = self.auth_client.exchange_access_token(
self.workflow.executor_settings.oidc_access_token,
["offline_access"],
[
"offline_access",
"ga4gh_passport_v1",
],
)

self._access_token = exchange_result["access_token"]
Expand All @@ -156,7 +159,11 @@ def __post_init__(self):
new_client = self.auth_client.register_client(
"run",
[self.workflow.executor_settings.oidc_audience],
["offline_access", "client_dynamic_deregistration"],
[
"offline_access",
"client_dynamic_deregistration",
"ga4gh_passport_v1",
],
)

self.auth_client = AuthClient(
Expand All @@ -167,7 +174,10 @@ def __post_init__(self):

exchange_result = self.auth_client.exchange_access_token(
self._access_token,
["offline_access"],
[
"offline_access",
"ga4gh_passport_v1",
],
self.workflow.executor_settings.oidc_audience,
)

Expand Down Expand Up @@ -352,7 +362,9 @@ def _prepare_file(

elif hasattr(iofile, "is_passthrough") and iofile.is_passthrough:
if iofile.passthrough_path.startswith("htsget://"):
members["url"] = iofile.passthrough_path.replace("htsget://", "htsget://bearer:" + self._get_access_token() + "@")
members["url"] = iofile.passthrough_path.replace(
"htsget://", "htsget://bearer:" + self.tes_access_token + "@"
)
else:
members["url"] = iofile.passthrough_path

Expand Down

0 comments on commit b894fe2

Please sign in to comment.