[25.1] Support credentials(secrets/variables) in tool requirements#19084
[25.1] Support credentials(secrets/variables) in tool requirements#19084mvdbeek merged 300 commits intogalaxyproject:release_25.1from
Conversation
lib/galaxy/tool_util/xsd/galaxy.xsd
Outdated
|
|
||
| ```xml | ||
| <requirements> | ||
| <secret type="vault" user_preferences_key="some_tool|api_key" inject_as_env="some_tool_api_key" label="API Key" required="true"/> |
There was a problem hiding this comment.
Do any of the use cases involve multiple tools with different IDs requesting the same secret? If not - I would make the tool id (without a version) an implicit prefix here and just attach some similar field as the suffix. This isolation feels more secure-ish to me - we wouldn't risk tools picking up other keys accidentally.
There was a problem hiding this comment.
Well, in some use cases, maybe in the future, it will be good to access an api_key or a token for multiple tools.
There was a problem hiding this comment.
Hi John, Arash, with @Marie59 and @jeremyfix we have such use case (if I well understand) where separate tools need the same credential (here this is Copernicus marine system credentials), so I confirm that this is already a reality ;) It appears to me, at least for ecology and related environmental sciences, that it will be the case for many data providers as Copernicus for satellites remote sensing data and others.
f14c777 to
bdf8667
Compare
dedb684 to
ff3ee10
Compare
ab6f860 to
7c8b58f
Compare
971fa21 to
64d382c
Compare
3530c3c to
18282cc
Compare
…ceCredentialsResponse classes
Updates credential validation to properly handle optional tool credentials by modifying warning conditions and status determination logic. Enhance documentation for status variant in user credentials composables. Changes exclamation icon display logic to show warnings when either required credentials are missing OR optional credentials are partially provided. Refines status computation to return appropriate states based on whether tools have required credentials, preventing incorrect success states when no credentials are needed.
Disables the run button and displays informative tooltip when required tool credentials are not provided by the user. Ensures workflows cannot be executed with incomplete credential configuration, preventing runtime errors and improving user experience through clear feedback.
Updates the credentials update and delete endpoints to require user credentials ID in the URL path, improving API consistency and enabling proper resource identification.
Modifies the PUT endpoint from `/credentials/group/{group_id}` to `/credentials/{user_credentials_id}/group/{group_id}` and updates the DELETE endpoint to include `/group/` segment for better REST API design.
Updates all related client code, tests, and API schema to handle the new endpoint structure with the additional user credentials ID parameter.
Co-authored-by: Arash Kadkhodaei <arash77.kad@gmail.com>
Relocates workflow credentials components from generic Common directory to specific Workflow/Run directory to improve code organization and maintainability. Updates import paths accordingly to maintain functionality while establishing clearer component hierarchy.
…d updates usage in FormTool
ecdbe91 to
a61aca1
Compare
|
The selenium errors don't fail elsewhere, this does look to be related. |
Wraps credential-related content in nested template to ensure proper rendering regardless of credential presence. Previously, the outer template with conditional rendering could cause display issues when credentials were absent.
Moves credential-related UI elements from FormCard component to WorkflowRunDefaultStep to improve component separation of concerns. Uses template slots to allow parent components to customize title area content rather than passing credential data as props.
|
Test Galaxy packages / Test (3.13) seems to be failing on other PRs too, so it’s not related to this PR. |
Related to #19196
Closes #17511
Summary
This PR implements a comprehensive tool credentials system for Galaxy, allowing tools to securely access external services by defining authentication credentials (variables and secrets) in tool requirements. The system provides secure credential management while keeping sensitive information separate from tool definitions.
Youtube Video
Blog Post in Galaxy Hub
Galaxy Tool XML Schema
Valut Documentations on Credentials
Key Features
🔐 Credential Definition in Tools
<credentials>elements within<requirements>🗃️ Secure Storage & Management
🌐 REST API
🎨 Frontend Integration
⚙️ Tool Execution Integration
Tool Definition Example
Screenshots
Tool Run Form
Tool with required credentials, but the user does not have a selection. The
Run Toolbutton is disabled.Tool with required credentials, and the user has a selection for every service
Tool with optional credentials, but the user does not have a selection.
Tool with required credentials, and the user has a selection for every service.
Tool with required and optional credentials, and the user does not have a selection. The
Run Toolbutton is disabled.Tool with required and optional credentials, and the user only has a selection for the required credentials.
Manage & Select Credentials Groups Modal for Tool. User can create, select or delete a group.
Manage & Select Credentials Groups Modal for Tool
Workflow Run Form
Workflow Editor
Workflow Editor
Workflow simple run with required credentials, but the user does not have a selection. The
Run Workflowbutton is disabled.Workflow run form with required credentials, but the user does not have a selection. The
Run Workflowbutton is disabled.Workflow simple run with optional credentials, but the user does not have a selection.
Workflow simple run with optional credentials, but the user does not have a selection.
Manage & Select Credentials Groups Modal for Tools in Workflow. User can create, select or delete a group for each tool.
All User Credentials Management
Database Schema
erDiagram galaxy_user ||--o{ user_credentials : "owns" user_credentials ||--o{ credentials_group : "contains" user_credentials ||--o| credentials_group : "current_group" credentials_group ||--o{ credential : "stores" job ||--o{ job_credentials_context : "uses" user_credentials ||--o{ job_credentials_context : "references" credentials_group ||--o{ job_credentials_context : "selected_group" galaxy_user { int id PK } user_credentials { int id PK int user_id FK string source_type string source_id string source_version string name string version int current_group_id FK datetime create_time datetime update_time } credentials_group { int id PK int user_credentials_id FK string name datetime create_time datetime update_time } credential { int id PK int group_id FK string name boolean is_secret boolean is_set string value datetime create_time datetime update_time } job { int id PK } job_credentials_context { int id PK int job_id FK int user_credentials_id FK string service_name string service_version int selected_group_id FK string selected_group_name }API Endpoints
GET /api/users/{user_id}/credentials?source_type=tool&source_id={tool_id}&source_version={tool_version}&include_definition={true|false}- List user credentialsPOST /api/users/{user_id}/credentials- Provide credentialsPUT /api/users/{user_id}/credentials- Update credential group selectionPUT /api/users/{user_id}/credentials/{user_credentials_id}/groups/{group_id}- Update specific groupDELETE /api/users/{user_id}/credentials/{user_credentials_id}- Delete service credentialsDELETE /api/users/{user_id}/credentials/{user_credentials_id}/groups/{group_id}- Delete specific groupHow to test the changes?
(Select all options that apply)
test/functional/tools/secret_tool.xml)2a. Open the tool run form
2b. Create a workflow using the tool and try to run it
User Preferences -> Credentials ManagementLicense