pub struct StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static, { /* private fields */ }Expand description
Standard OAuth2 token introspection response.
This struct includes the fields defined in
Section 2.2 of RFC 7662, as well as
extensions defined by the EF type parameter.
Implementations
sourceimpl<EF, TT> StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType,
impl<EF, TT> StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType,
sourcepub fn new(active: bool, extra_fields: EF) -> Self
pub fn new(active: bool, extra_fields: EF) -> Self
Instantiate a new OAuth2 token introspection response.
sourcepub fn set_active(&mut self, active: bool)
pub fn set_active(&mut self, active: bool)
Sets the set_active field.
sourcepub fn set_scopes(&mut self, scopes: Option<Vec<Scope>>)
pub fn set_scopes(&mut self, scopes: Option<Vec<Scope>>)
Sets the set_scopes field.
sourcepub fn set_client_id(&mut self, client_id: Option<ClientId>)
pub fn set_client_id(&mut self, client_id: Option<ClientId>)
Sets the set_client_id field.
sourcepub fn set_username(&mut self, username: Option<String>)
pub fn set_username(&mut self, username: Option<String>)
Sets the set_username field.
sourcepub fn set_token_type(&mut self, token_type: Option<TT>)
pub fn set_token_type(&mut self, token_type: Option<TT>)
Sets the set_token_type field.
sourcepub fn extra_fields(&self) -> &EF
pub fn extra_fields(&self) -> &EF
Extra fields defined by the client application.
sourcepub fn set_extra_fields(&mut self, extra_fields: EF)
pub fn set_extra_fields(&mut self, extra_fields: EF)
Sets the set_extra_fields field.
Trait Implementations
sourceimpl<EF: Clone, TT: Clone> Clone for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
impl<EF: Clone, TT: Clone> Clone for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
sourcefn clone(&self) -> StandardTokenIntrospectionResponse<EF, TT>
fn clone(&self) -> StandardTokenIntrospectionResponse<EF, TT>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<EF: Debug, TT: Debug> Debug for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
impl<EF: Debug, TT: Debug> Debug for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
sourceimpl<'de, EF, TT> Deserialize<'de> for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
TT: TokenType,
EF: ExtraTokenFields,
impl<'de, EF, TT> Deserialize<'de> for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
TT: TokenType,
EF: ExtraTokenFields,
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<EF, TT> Serialize for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
TT: TokenType,
EF: ExtraTokenFields,
impl<EF, TT> Serialize for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType + 'static,
TT: TokenType,
EF: ExtraTokenFields,
sourceimpl<EF, TT> TokenIntrospectionResponse<TT> for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType,
impl<EF, TT> TokenIntrospectionResponse<TT> for StandardTokenIntrospectionResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType,
sourcefn active(&self) -> bool
fn active(&self) -> bool
REQUIRED. Boolean indicator of whether or not the presented token is currently active. The specifics of a token’s “active” state will vary depending on the implementation of the authorization server and the information it keeps about its tokens, but a “true” value return for the “active” property will generally indicate that a given token has been issued by this authorization server, has not been revoked by the resource owner, and is within its given time window of validity (e.g., after its issuance time and before its expiration time). Read more
sourcefn scopes(&self) -> Option<&Vec<Scope>>
fn scopes(&self) -> Option<&Vec<Scope>>
OPTIONAL. A JSON string containing a space-separated list of
scopes associated with this token, in the format described in
Section 3.3 of RFC 7662.
If included in the response,
this space-delimited field is parsed into a Vec of individual scopes. If omitted from
the response, this field is None. Read more
sourcefn client_id(&self) -> Option<&ClientId>
fn client_id(&self) -> Option<&ClientId>
OPTIONAL. Client identifier for the OAuth 2.0 client that requested this token. Read more
sourcefn username(&self) -> Option<&str>
fn username(&self) -> Option<&str>
OPTIONAL. Human-readable identifier for the resource owner who authorized this token. Read more
sourcefn token_type(&self) -> Option<&TT>
fn token_type(&self) -> Option<&TT>
OPTIONAL. Type of the token as defined in
Section 5.1 of RFC 7662.
Value is case insensitive and deserialized to the generic TokenType parameter. Read more
Auto Trait Implementations
impl<EF, TT> RefUnwindSafe for StandardTokenIntrospectionResponse<EF, TT> where
EF: RefUnwindSafe,
TT: RefUnwindSafe,
impl<EF, TT> Send for StandardTokenIntrospectionResponse<EF, TT> where
EF: Send,
TT: Send,
impl<EF, TT> Sync for StandardTokenIntrospectionResponse<EF, TT> where
EF: Sync,
TT: Sync,
impl<EF, TT> Unpin for StandardTokenIntrospectionResponse<EF, TT> where
EF: Unpin,
TT: Unpin,
impl<EF, TT> UnwindSafe for StandardTokenIntrospectionResponse<EF, TT> where
EF: UnwindSafe,
TT: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more