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§
Source§impl<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§
Source§impl<EF, TT> Clone for StandardTokenIntrospectionResponse<EF, TT>
impl<EF, TT> Clone for StandardTokenIntrospectionResponse<EF, TT>
Source§fn clone(&self) -> StandardTokenIntrospectionResponse<EF, TT>
fn clone(&self) -> StandardTokenIntrospectionResponse<EF, TT>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<EF, TT> Debug for StandardTokenIntrospectionResponse<EF, TT>
impl<EF, TT> Debug for StandardTokenIntrospectionResponse<EF, TT>
Source§impl<'de, EF, TT> Deserialize<'de> for StandardTokenIntrospectionResponse<EF, TT>where
EF: ExtraTokenFields,
TT: TokenType + 'static,
impl<'de, EF, TT> Deserialize<'de> for StandardTokenIntrospectionResponse<EF, TT>where
EF: ExtraTokenFields,
TT: TokenType + 'static,
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<EF, TT> Serialize for StandardTokenIntrospectionResponse<EF, TT>where
EF: ExtraTokenFields,
TT: TokenType + 'static,
impl<EF, TT> Serialize for StandardTokenIntrospectionResponse<EF, TT>where
EF: ExtraTokenFields,
TT: TokenType + 'static,
Source§impl<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,
Source§fn 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).
Source§fn 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
.Source§fn client_id(&self) -> Option<&ClientId>
fn client_id(&self) -> Option<&ClientId>
OPTIONAL. Client identifier for the OAuth 2.0 client that
requested this token.
Source§fn username(&self) -> Option<&str>
fn username(&self) -> Option<&str>
OPTIONAL. Human-readable identifier for the resource owner who
authorized this token.
Source§fn 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.Source§fn exp(&self) -> Option<DateTime<Utc>>
fn exp(&self) -> Option<DateTime<Utc>>
OPTIONAL. Integer timestamp, measured in the number of seconds
since January 1 1970 UTC, indicating when this token will expire,
as defined in JWT RFC7519.
Source§fn iat(&self) -> Option<DateTime<Utc>>
fn iat(&self) -> Option<DateTime<Utc>>
OPTIONAL. Integer timestamp, measured in the number of seconds
since January 1 1970 UTC, indicating when this token was
originally issued, as defined in JWT RFC7519.
Source§fn nbf(&self) -> Option<DateTime<Utc>>
fn nbf(&self) -> Option<DateTime<Utc>>
OPTIONAL. Integer timestamp, measured in the number of seconds
since January 1 1970 UTC, indicating when this token is not to be
used before, as defined in JWT RFC7519.
Source§fn sub(&self) -> Option<&str>
fn sub(&self) -> Option<&str>
OPTIONAL. Subject of the token, as defined in JWT RFC7519.
Usually a machine-readable identifier of the resource owner who
authorized this token.
Source§fn aud(&self) -> Option<&Vec<String>>
fn aud(&self) -> Option<&Vec<String>>
OPTIONAL. Service-specific string identifier or list of string
identifiers representing the intended audience for this token, as
defined in JWT RFC7519.
Auto Trait Implementations§
impl<EF, TT> Freeze for StandardTokenIntrospectionResponse<EF, TT>
impl<EF, TT> RefUnwindSafe for StandardTokenIntrospectionResponse<EF, TT>where
EF: RefUnwindSafe,
TT: RefUnwindSafe,
impl<EF, TT> Send for StandardTokenIntrospectionResponse<EF, TT>
impl<EF, TT> Sync for StandardTokenIntrospectionResponse<EF, TT>
impl<EF, TT> Unpin for StandardTokenIntrospectionResponse<EF, TT>
impl<EF, TT> UnwindSafe for StandardTokenIntrospectionResponse<EF, TT>where
EF: UnwindSafe,
TT: UnwindSafe,
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