AuthMetadataBuilder

Struct AuthMetadataBuilder 

Source
pub struct AuthMetadataBuilder<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> AuthMetadataBuilder<'a>

Source

pub fn new(protected_resource_url: &'a str) -> Self

Creates a new instance of the builder for the given protected resource. The protected_resource parameter must specify the full URL of the MCP server.

Source

pub async fn from_discovery_url<S>( discovery_url: &str, protected_resource: S, required_scopes: Vec<S>, ) -> Result<Self, McpSdkError>
where S: Into<Cow<'a, str>>,

Source

pub fn scopes_supported<S>(self, scopes: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn issuer<S>(self, issuer: S) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn service_documentation<S>(self, url: S) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn authorization_endpoint<S>(self, url: S) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn token_endpoint<S>(self, url: S) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn response_types_supported<S>(self, types: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn response_modes_supported<S>(self, modes: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn registration_endpoint(self, url: &'a str) -> Self

Source

pub fn userinfo_endpoint(self, url: &'a str) -> Self

Source

pub fn grant_types_supported<S>(self, types: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn token_endpoint_auth_methods_supported<S>(self, methods: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn token_endpoint_auth_signing_alg_values_supported<S>( self, algs: Vec<S>, ) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn revocation_endpoint(self, url: &'a str) -> Self

Source

pub fn revocation_endpoint_auth_methods_supported<S>( self, methods: Vec<S>, ) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn revocation_endpoint_auth_signing_alg_values_supported<S>( self, algs: Vec<S>, ) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn introspection_endpoint(self, endpoint: &'a str) -> Self

Source

pub fn introspection_endpoint_auth_methods_supported<S>( self, methods: Vec<S>, ) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn introspection_endpoint_auth_signing_alg_values_supported<S>( self, algs: Vec<String>, ) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn code_challenge_methods_supported<S>(self, methods: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn resource(self, url: &'a str) -> Self

Source

pub fn authorization_servers(self, servers: Vec<&'a str>) -> Self

Source

pub fn reqquired_scopes<S>(self, scopes: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn resource_documentation<S>(self, doc: String) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn jwks_uri(self, url: &'a str) -> Self

Source

pub fn bearer_methods_supported<S>(self, methods: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn resource_signing_alg_values_supported<S>(self, algs: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn resource_name<S>(self, name: S) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn resource_policy_uri(self, url: &'a str) -> Self

Source

pub fn resource_tos_uri(self, url: &'a str) -> Self

Source

pub fn tls_client_certificate_bound_access_tokens(self, value: bool) -> Self

Source

pub fn authorization_details_types_supported<S>(self, types: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn dpop_signing_alg_values_supported<S>(self, algs: Vec<S>) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn dpop_bound_access_tokens_required(self, value: bool) -> Self

Source

pub fn build( self, ) -> Result<(AuthorizationServerMetadata, OauthProtectedResourceMetadata), McpSdkError>

Trait Implementations§

Source§

impl<'a> Default for AuthMetadataBuilder<'a>

Source§

fn default() -> AuthMetadataBuilder<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more