pub struct McpClientCredentials {
pub client_id: String,
pub client_secret: String,
pub scopes: Option<Vec<String>>,
pub allow_private_addresses: bool,
}Expand description
OAuth client credentials for machine-to-machine authentication (McpClientCredentials).
The client discovers the authorization server from the MCP server’s protected resource metadata and exchanges the credentials for a token on every connect, and again whenever the server rejects the token or it expires.
Discovery refuses metadata that points at private addresses unless the server URL itself
names one of the same class (such as localhost); set
allow_private_addresses for an authorization server on a
private network. Link-local and other reserved addresses are always refused.
Fields§
§client_id: StringThe OAuth client id.
client_secret: StringThe OAuth client secret.
scopes: Option<Vec<String>>The scopes to request.
allow_private_addresses: boolLets discovered metadata name hosts that resolve to private addresses
(allowPrivateAddresses). Defaults to false.
Implementations§
Source§impl McpClientCredentials
impl McpClientCredentials
Sourcepub fn builder() -> McpClientCredentialsBuilder
pub fn builder() -> McpClientCredentialsBuilder
Create an instance of McpClientCredentials using the builder syntax
Trait Implementations§
Source§impl Clone for McpClientCredentials
impl Clone for McpClientCredentials
Source§impl Debug for McpClientCredentials
impl Debug for McpClientCredentials
Source§impl Default for McpClientCredentials
impl Default for McpClientCredentials
Source§impl<'de> Deserialize<'de> for McpClientCredentials
impl<'de> Deserialize<'de> for McpClientCredentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for McpClientCredentials
Source§impl PartialEq for McpClientCredentials
impl PartialEq for McpClientCredentials
impl StructuralPartialEq for McpClientCredentials
Auto Trait Implementations§
impl Freeze for McpClientCredentials
impl RefUnwindSafe for McpClientCredentials
impl Send for McpClientCredentials
impl Sync for McpClientCredentials
impl Unpin for McpClientCredentials
impl UnsafeUnpin for McpClientCredentials
impl UnwindSafe for McpClientCredentials
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more