From 25488e4aa1cb969b1cd3467c47c8bc4c84fb02dc Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 20 Dec 2024 14:02:53 +0100 Subject: [PATCH] remove vault in evaluation and MinimalToolApp --- lib/galaxy/structured_app.py | 1 - lib/galaxy/tools/evaluation.py | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/structured_app.py b/lib/galaxy/structured_app.py index 473c11e00d4e..1d1986dee1a8 100644 --- a/lib/galaxy/structured_app.py +++ b/lib/galaxy/structured_app.py @@ -90,7 +90,6 @@ class MinimalToolApp(Protocol): tool_data_tables: "ToolDataTableManager" file_sources: ConfiguredFileSources security: IdEncodingHelper - vault: Vault class MinimalApp(BasicSharedApp): diff --git a/lib/galaxy/tools/evaluation.py b/lib/galaxy/tools/evaluation.py index 5c13b48e7349..e15551ad0771 100644 --- a/lib/galaxy/tools/evaluation.py +++ b/lib/galaxy/tools/evaluation.py @@ -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, @@ -190,9 +189,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) - # 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 @@ -200,7 +198,7 @@ def set_compute_environment(self, compute_environment: ComputeEnvironment, get_s 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"