pub struct DiscoveryClient { /* private fields */ }Expand description
Discovery client for authorization server metadata
Implementations§
Source§impl DiscoveryClient
impl DiscoveryClient
Sourcepub fn with_client(client: Client) -> Self
pub fn with_client(client: Client) -> Self
Create with custom HTTP client
Sourcepub async fn discover_from_resource(
&self,
_resource_url: &str,
) -> McpResult<ProtectedResourceMetadata>
pub async fn discover_from_resource( &self, _resource_url: &str, ) -> McpResult<ProtectedResourceMetadata>
Discover authorization server from Protected Resource Metadata
This follows RFC 9728 to discover the authorization server(s) for a protected resource (MCP server).
Sourcepub fn parse_www_authenticate(
&self,
header_value: &str,
) -> McpResult<Option<String>>
pub fn parse_www_authenticate( &self, header_value: &str, ) -> McpResult<Option<String>>
Parse WWW-Authenticate header and extract optional resource metadata URL.
resource_metadata is optional in newer MCP auth guidance; callers should
fall back to protected-resource discovery from the MCP resource URL when absent.
Sourcepub async fn discover_auth_server(
&self,
issuer_url: &str,
) -> McpResult<AuthorizationServerMetadata>
pub async fn discover_auth_server( &self, issuer_url: &str, ) -> McpResult<AuthorizationServerMetadata>
Discover authorization server metadata
This tries multiple discovery endpoints in priority order:
- OAuth 2.0 Authorization Server Metadata (RFC 8414)
- OpenID Connect Discovery
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DiscoveryClient
impl !UnwindSafe for DiscoveryClient
impl Freeze for DiscoveryClient
impl Send for DiscoveryClient
impl Sync for DiscoveryClient
impl Unpin for DiscoveryClient
impl UnsafeUnpin for DiscoveryClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].