Skip to content

Commit

Permalink
Don't assume default master key works
Browse files Browse the repository at this point in the history
Should fix #1476?
We might want to see which commands can (at least in principle) work
fine without auth.
  • Loading branch information
mvdbeek committed Sep 26, 2024
1 parent cde40e5 commit 98c47f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions planemo/galaxy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions planemo/galaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit 98c47f9

Please sign in to comment.