pub struct OAuthScopeChallenge {
pub required_scopes: Vec<String>,
pub resource_metadata: Option<String>,
pub error_description: Option<String>,
}Expand description
An OAuth insufficient_scope Bearer challenge.
MCP authorization servers use this challenge on HTTP 403 responses to tell
clients which additional scopes are required for the attempted operation.
See OAuthScopeChallenge::from_www_authenticate for parsing.
Fields§
§required_scopes: Vec<String>Scopes requested by the authorization server.
resource_metadata: Option<String>Protected resource metadata URL supplied by the server.
error_description: Option<String>Human-readable description supplied by the server.
Implementations§
Source§impl OAuthScopeChallenge
impl OAuthScopeChallenge
Sourcepub fn from_www_authenticate(header: &str) -> Option<Self>
pub fn from_www_authenticate(header: &str) -> Option<Self>
Parse an insufficient_scope Bearer challenge from a
WWW-Authenticate header value.
Returns None for other authentication schemes, other OAuth errors,
or challenges that do not include at least one required scope.
Trait Implementations§
Source§impl Clone for OAuthScopeChallenge
impl Clone for OAuthScopeChallenge
Source§fn clone(&self) -> OAuthScopeChallenge
fn clone(&self) -> OAuthScopeChallenge
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OAuthScopeChallenge
impl Debug for OAuthScopeChallenge
impl Eq for OAuthScopeChallenge
Source§impl PartialEq for OAuthScopeChallenge
impl PartialEq for OAuthScopeChallenge
impl StructuralPartialEq for OAuthScopeChallenge
Auto Trait Implementations§
impl Freeze for OAuthScopeChallenge
impl RefUnwindSafe for OAuthScopeChallenge
impl Send for OAuthScopeChallenge
impl Sync for OAuthScopeChallenge
impl Unpin for OAuthScopeChallenge
impl UnsafeUnpin for OAuthScopeChallenge
impl UnwindSafe for OAuthScopeChallenge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.