Class McpProtectedResourceMetadataClient.Builder
java.lang.Object
org.apache.juneau.rest.client.mcp.auth.McpProtectedResourceMetadataClient.Builder
- Enclosing class:
- McpProtectedResourceMetadataClient
Builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowInsecureHttp(boolean value) Allows plainhttpPRM / authorization-server URLs (loopback hosts are always allowed regardless).build()Builds the client.expectedResource(URI value) Sets the expectedresourceidentifier the PRM document'sresourcefield is validated against (RFC 9728 §3.3).httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequestused for the PRM fetch and AS discovery.httpTimeout(Duration value) Sets the connect/read timeout applied to the PRM fetch and AS discovery.
-
Constructor Details
-
Builder
protected Builder()Constructor.
-
-
Method Details
-
expectedResource
Sets the expectedresourceidentifier the PRM document'sresourcefield is validated against (RFC 9728 §3.3).This is the canonical URI of the MCP server the client was actually talking to. A per-call value passed to
McpProtectedResourceMetadataClient.fetch(URI, URI)/McpProtectedResourceMetadataClient.parse(String, URI, URI)overrides this.- Parameters:
value- The expected resource identifier. Must not benull .- Returns:
- This object.
-
httpTimeout
Sets the connect/read timeout applied to the PRM fetch and AS discovery. Default 10 seconds.- Parameters:
value- The timeout. Must not benull and must be positive.- Returns:
- This object.
-
allowInsecureHttp
Allows plainhttpPRM / authorization-server URLs (loopback hosts are always allowed regardless).- Parameters:
value-true to skip thehttpsscheme check.- Returns:
- This object.
-
httpRequestConfigurator
public McpProtectedResourceMetadataClient.Builder httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequestused for the PRM fetch and AS discovery.- Parameters:
value- The callback. Must not benull .- Returns:
- This object.
-
build
Builds the client.- Returns:
- A new
McpProtectedResourceMetadataClient.
-