Repository navigation
Fixes #28299: keep secret keys of list elements distinct - #38190
Khairajani wants to merge 2 commits into
Conversation
…tinct once cleaned
Code Review ✅ Approved 🔴 High risk 2 closed / 2 findingsChanging MCP collection secret-key derivation and mask matching affects stored secret integrity; a key collision could overwrite or misassign a server's API key. Fixes secret key collisions for list elements by keying restores on exact names and using a separate, normalized secret id that falls back to position when names clash. The MCP exact-match check that could swap positional keys and the ADR wording that still described the old rule were both addressed. No open issues found. ✅ 2 closed✅ Bug: MCP name check still exact-match, so positional names can swap keys
✅ Quality: Keying rule changes, but the ADR still says 'name when it occurs once'
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Folded into #38117. |
Fixes #28299
Follow-up to #33477, from the review of #38118.
servers[].apiKey) is keyed by its name when that name is unique, and by position (#0,#1, ...) otherwise. Two cases still gave two elements the same key, so one server's key could overwrite another's:#1matched a position key;Prodandprod, orprod-1andprod_1, were unique but map to one secret id in AWS, Azure, GCP and Kubernetes secrets managers, which lowercase the id and drop or replace other characters.Prodandprod(or servers1and2) keep their own keys through a reorder or a delete. A name starting with#gets one more#, so it never equals a position key.ADR:2026-11-11-mcp-service-server-names-are-unique-and-masks-need-a-stored-valuegets a v3 amendment with both rules.ReflectionUtilCollectionKeysTestfailed first on the three collisions. NewPasswordEntityMaskerTestcases (reorder ofProd/prod, deleting server1, a#1name next to repeated names) failed on the first version of this fix. All pass now, with the other secrets tests.🤖 Generated with Claude Code


Confidence Score: 5/5
The changes appear safe to merge.Summary
Separates how list elements are matched during secret restoration from how their secret-store IDs are built.
The previous finding is addressed. No new actionable issues were found in the changes since the last review. Tests were inspected, not run.
Reviews (2) · Last reviewed commit: "Match masked list secrets by exact name,..." · Reviewed by Greptile