refactor(mcp): share protected resource metadata discovery - #3955
Draft
aheritier wants to merge 1 commit into
Draft
refactor(mcp): share protected resource metadata discovery#3955aheritier wants to merge 1 commit into
aheritier wants to merge 1 commit into
Conversation
aheritier
force-pushed
the
fix/3879-prm-helper-extraction
branch
from
August 10, 2026 20:28
7a6a2a8 to
424cda1
Compare
Extract the duplicated RFC 9728 protected-resource-metadata fetch/decode logic from the managed and unmanaged OAuth flows into a single fetchProtectedResourceMetadata helper, keeping the existing supplied-origin-default and 404-tolerant behavior. The helper accepts optional fallback candidate URLs for the standalone CLI discovery flow without changing runtime callers.
aheritier
force-pushed
the
fix/3879-prm-helper-extraction
branch
from
August 10, 2026 21:30
424cda1 to
6898c31
Compare
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.
Stacked on #3881.
Extracts duplicated RFC 9728 protected-resource metadata fetch/decode/defaulting from managed and docker-agent-driven unmanaged OAuth into a shared helper. Runtime fallback remains disabled, while explicit ordered fallback support is enabled for forthcoming standalone CLI work.
Adds deterministic local tests covering exact candidates/GET/order, hard stops (invalid JSON and non-200 responses including 204), 404 exhaustion, metadata preservation, and no downstream OAuth activity after hard errors. Clarifies the RequestedScopes comment.