Skip to content

Commit

Permalink
cast app for using vault into StructuredApp
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Oct 31, 2024
1 parent 437cee0 commit c74e8ce
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/galaxy/tools/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import (
Any,
Callable,
cast,
Dict,
List,
Optional,
Expand All @@ -31,6 +32,7 @@
from galaxy.security.vault import UserVaultWrapper
from galaxy.structured_app import (
BasicSharedApp,
MinimalToolApp,
StructuredApp,
)
from galaxy.tool_util.data import TabularToolDataTable
Expand Down Expand Up @@ -127,11 +129,11 @@ class ToolEvaluator:
tool inputs in an isolated, testable manner.
"""

app: StructuredApp
app: MinimalToolApp
job: model.Job
materialize_datasets: bool = True

def __init__(self, app: StructuredApp, tool, job, local_working_directory):
def __init__(self, app: MinimalToolApp, tool, job, local_working_directory):
self.app = app
self.job = job
self.tool = tool
Expand Down Expand Up @@ -190,7 +192,8 @@ def set_compute_environment(self, compute_environment: ComputeEnvironment, get_s
self.execute_tool_hooks(inp_data=inp_data, out_data=out_data, incoming=incoming)

if self.tool.secrets:
user_vault = UserVaultWrapper(self.app.vault, self._user)
app = cast(StructuredApp, self.app)
user_vault = UserVaultWrapper(app.vault, self._user)
for secret in self.tool.secrets:
vault_key = secret.user_preferences_key
secret_value = user_vault.read_secret("preferences/" + vault_key)
Expand Down

0 comments on commit c74e8ce

Please sign in to comment.