Skip to content

Commit

Permalink
remove vault in evaluation and MinimalToolApp
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Dec 20, 2024
1 parent ba9cf0b commit 25488e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/galaxy/structured_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class MinimalToolApp(Protocol):
tool_data_tables: "ToolDataTableManager"
file_sources: ConfiguredFileSources
security: IdEncodingHelper
vault: Vault


class MinimalApp(BasicSharedApp):
Expand Down
6 changes: 2 additions & 4 deletions lib/galaxy/tools/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
)
from galaxy.model.none_like import NoneDataset
from galaxy.security.object_wrapper import wrap_with_safe_string
from galaxy.security.vault import UserVaultWrapper
from galaxy.structured_app import (
BasicSharedApp,
MinimalToolApp,
Expand Down Expand Up @@ -190,17 +189,16 @@ def set_compute_environment(self, compute_environment: ComputeEnvironment, get_s
)
self.execute_tool_hooks(inp_data=inp_data, out_data=out_data, incoming=incoming)

# TODO: provide all information needed (variable value, current group, etc) to this part...
# TODO: provide all information needed (secret value, variable value, current group, etc) to this part...
if hasattr(self.tool, "credentials"):
user_vault = UserVaultWrapper(self.app.vault, self._user)
tool_credentials: List[CredentialsRequirement] = self.tool.credentials
for credentials in tool_credentials:
reference = credentials.reference
current_group = "default"
tool_id = self.tool.id
for secret in credentials.secrets:
vault_ref = f"tool|{tool_id}|{reference}|{current_group}|{secret.name}"
vault_value = user_vault.read_secret(vault_ref) or ""
vault_value = f"user_vault.read_secret({vault_ref})"
self.environment_variables.append({"name": secret.inject_as_env, "value": vault_value})
for variable in credentials.variables:
variable_value = "variable.value"
Expand Down

0 comments on commit 25488e4

Please sign in to comment.