Class McpWellKnownRouting
java.lang.Object
org.apache.juneau.rest.server.mcp.v20260728.McpWellKnownRouting
Pure, side-effect-free construction of the RFC 9728 / SEP-2351 well-known Protected Resource Metadata (PRM) URIs for a
given canonical resource identifier.
Per RFC 9728 §3.1 and
SEP-2351, the well-known segment /.well-known/oauth-protected-resource is inserted between the host and the
resource's path component:
- Resource
https://host/mcp→ PRM athttps://host/.well-known/oauth-protected-resource/mcp(path-insertion). - Resource
https://host(no path) → PRM athttps://host/.well-known/oauth-protected-resource(root form).
candidates(URI) returns the ordered client lookup sequence — the path-inserted URI first, then the root
fallback — matching the ordered fallback SEP-2351 specifies. The server hosts the path-inserted form (and, for
a rooted resource, that is the root form).
- Since:
- 10.0.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncandidates(URI resource) Returns the ordered PRM lookup candidates — the path-inserted URI first, then the root fallback (SEP-2351).static URImetadataUri(URI resource) Returns the path-inserted PRM URI for the supplied resource identifier (RFC 9728 §3.1).static URIrootMetadataUri(URI resource) Returns the root-form PRM URI for the supplied resource identifier — the ordered fallback location (SEP-2351).static StringwellKnownRequestPath(URI resource) Returns the servlet-relative request path at which this server hosts its PRM document for the supplied resource identifier — i.e.
-
Field Details
-
WELL_KNOWN_PATH
The RFC 9728 well-known path segment.- See Also:
-
-
Method Details
-
metadataUri
Returns the path-inserted PRM URI for the supplied resource identifier (RFC 9728 §3.1).- Parameters:
resource- The canonical resource identifier. Must not benull and must be absolute (scheme + authority).- Returns:
- The PRM document URI.
- Throws:
IllegalArgumentException- Ifresourceisnull or is missing a scheme/authority.
-
rootMetadataUri
Returns the root-form PRM URI for the supplied resource identifier — the ordered fallback location (SEP-2351).- Parameters:
resource- The canonical resource identifier. Must not benull and must be absolute (scheme + authority).- Returns:
- The root PRM document URI.
- Throws:
IllegalArgumentException- Ifresourceisnull or is missing a scheme/authority.
-
candidates
Returns the ordered PRM lookup candidates — the path-inserted URI first, then the root fallback (SEP-2351).When the resource has no path component the two coincide and a single-element list is returned.
- Parameters:
resource- The canonical resource identifier. Must not benull and must be absolute (scheme + authority).- Returns:
- The ordered candidate list (1 or 2 entries). Never
null . - Throws:
IllegalArgumentException- Ifresourceisnull or is missing a scheme/authority.
-
wellKnownRequestPath
Returns the servlet-relative request path at which this server hosts its PRM document for the supplied resource identifier — i.e.metadataUri(URI)'s path component.- Parameters:
resource- The canonical resource identifier. Must not benull .- Returns:
- The request path (e.g.
/.well-known/oauth-protected-resource/mcp). - Throws:
IllegalArgumentException- Ifresourceisnull .
-