feat(mcp): add server-managed bearer credential references - #1663
Open
FenjuFu wants to merge 2 commits into
Open
feat(mcp): add server-managed bearer credential references#1663FenjuFu wants to merge 2 commits into
FenjuFu wants to merge 2 commits into
Conversation
Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first secure backend slice for authenticated URL-based MCP servers.
plugin-linkcan now resolve a Bearer credential from an operator-managed environment reference bound to an exact HTTPS MCP URL, without adding tokens to workflow JSON, public request schemas, database rows, logs, or telemetry.This advances, but does not close, #1661. UI/database-backed credential management and tenant-scoped secret lifecycle remain follow-up work.
Type of Change
Related Issue
Refs #1661.
Also enables the authenticated client half needed by:
Changes
MCP_SERVER_BEARER_TOKEN_REFS, a bounded JSON map from exact final HTTPS MCP URL to secret environment-variable nameplugin-linkand suppliesAuthorization: Bearer ...through the officialhttpx/MCP SDK clientinitialized_mcp_sessionExample operator configuration (the token value must be injected separately by deployment secret storage):
Security properties
Testing
uv run python -m pytest tests/unit -q? 220 passedScope / follow-ups
This PR deliberately does not persist credentials in Astron tables or expose a frontend secret editor. The environment reference is a deployer-managed first stage that supports rotation without rewriting workflows. A later #1661 PR can replace/augment the resolver with tenant-scoped secret storage while keeping the same transport contract and tests.
Screenshots
Not applicable; no UI changes.
Checklist
Persistence update
Commit
8a9b8cd2adds V1.49 persistence forauth_typeand RSA-encryptedcredential_ciphertext, validates Bearer configuration before workflow release side effects, and exposes onlyhasCredentialin response DTOs. The ciphertext is never returned.Validation:
McpServiceImplBusinessExceptionTest: 2 passed