Repository navigation
refactor(auth): unify search and MCP API keys in auth.yaml - #2591
Merged
Merged
Conversation
Move search credentials into their own namespace and use api_key for MCP file credentials. Share static-key schema validation, allow websearch as a custom LLM provider ID, and cover namespace isolation and request delivery. Co-authored-by: Mecatl <noreply@mecatl.dev>
Contributor
Author
Approved review decisionsThis concise record supersedes the earlier detailed plan archive and incorporates the follow-up review decisions:
The PR description contains the current behavior, compatibility assessment, and validation summary. |
Resolve search API keys through the existing kind-aware credential source while preserving search and MCP precedence, snapshot, and validation policies. Cover concurrent lookups and remove credential conversion walkthroughs. Co-authored-by: Mecatl <noreply@mecatl.dev>
Resolve canonical MCP and search token environment names consistently, retain table-driven search aliases, and accept arbitrary valid search credential IDs. Co-authored-by: Mecatl <noreply@mecatl.dev>
Use one source-resolution policy for MCP and search, leave bearer validation to the MCP caller, and propagate cached search source errors. Co-authored-by: Mecatl <noreply@mecatl.dev>
Use one environment lookup callback and keep alias precedence and batch snapshots inside the credential source. Remove caller-supplied fallback values from lock-held lookups. Co-authored-by: Mecatl <noreply@mecatl.dev>
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
Closes #2578. Unify static API-key handling while keeping LLM, search, and MCP credentials in separate
auth.yamlnamespaces.search.<id>.api_keyandmcp.<id>.api_key; preserve LLM/OAuth formats and provider writes. Allowwebsearchas a custom LLM ID without sharing its search credential.[a-z0-9_]+. ResolveMECATL_{SEARCH,MCP}_TOKEN_<UPPERCASE_ID>first, then registered search aliases, then the matching file entry. Arbitrary search credentials do not register search backends.EXA_API_KEY,BRAVE_API_KEY, andWEBSEARCH_API_KEYas search aliases. Present-empty canonical variables block fallback; empty aliases act as absent.Compatibility
The operator approved a breaking operator configuration/storage schema cleanup: move search keys out of
providersintosearch, and rename MCP's file field fromtokentoapi_key. Obsolete forms receive ordinary validation; there are no old-schema lookups or automatic rewrites. Explicitly configured custom LLM IDs remain valid underproviders.API compatibility: no gRPC/HTTP/SDK contract, API major, feature identifier, public Go API, or session-data migration changes. Existing clients remain compatible. Rollback requires restoring the previous credential-file schema. MCP selectors, flag-server token variables, and OAuth field names are unchanged. General secret management (#2585) remains out of scope.
Validation
Passed:
task test,task test:race,task lint,task docs,task site:build, and the offline demo (tool call, approval, and result). No live providers exercised.Regression coverage includes schema validation and preserving writes; namespace isolation; arbitrary IDs; canonical/alias/file precedence; strict source failures; cached/reselected paths; snapshot timing and concurrency; MCP header safety; and search request delivery/non-forwarding. Independent model-provider startup validation remains separate from individual search/MCP lookup policy.