From 98c47f9a56ae556b5ccbfedc519488db7848fcdb Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 26 Sep 2024 13:09:54 +0200 Subject: [PATCH] Don't assume default master key works Should fix https://github.com/galaxyproject/planemo/issues/1476? We might want to see which commands can (at least in principle) work fine without auth. --- planemo/galaxy/api.py | 4 +--- planemo/galaxy/config.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/planemo/galaxy/api.py b/planemo/galaxy/api.py index 6f4906f33..795e3aa86 100644 --- a/planemo/galaxy/api.py +++ b/planemo/galaxy/api.py @@ -14,8 +14,6 @@ def get_dict_from_workflow(gi: GalaxyInstance, workflow_id: str, instance: bool def gi(port: Optional[int] = None, url: Optional[str] = None, key: Optional[str] = None) -> GalaxyInstance: """Return a bioblend ``GalaxyInstance`` for Galaxy on this port.""" - if key is None: - key = DEFAULT_ADMIN_API_KEY if port is not None and url is not None: raise ValueError("Either port or url parameter needs to be None") if port is None: @@ -114,7 +112,7 @@ def summarize_history(ctx, gi, history_id): print("|") -def get_invocations(url, key, workflow_id): +def get_invocations(url, key: Optional[str], workflow_id): inv_gi = gi(None, url, key) invocations = inv_gi.workflows.get_invocations(workflow_id) return { diff --git a/planemo/galaxy/config.py b/planemo/galaxy/config.py index c4b6480b3..705b6d94f 100644 --- a/planemo/galaxy/config.py +++ b/planemo/galaxy/config.py @@ -641,9 +641,9 @@ def _shared_galaxy_properties(config_directory, kwds, for_tests): def external_galaxy_config(ctx, runnables, for_tests=False, **kwds): yield BaseGalaxyConfig( ctx=ctx, - galaxy_url=kwds.get("galaxy_url", None), - master_api_key=_get_master_api_key(kwds), - user_api_key=kwds.get("galaxy_user_key", None), + galaxy_url=kwds.get("galaxy_url"), + master_api_key=kwds.get("galaxy_admin_key"), + user_api_key=kwds.get("galaxy_user_key"), runnables=runnables, kwds=kwds, )