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,

source

pub fn new( active: bool, extra_fields: EF ) -> StandardTokenIntrospectionResponse<EF, TT>

Instantiate a new OAuth2 token introspection response.

source

pub fn set_active(&mut self, active: bool)

Sets the set_active field.

source

pub fn set_scopes(&mut self, scopes: Option<Vec<Scope>>)

Sets the set_scopes field.

source

pub fn set_client_id(&mut self, client_id: Option<ClientId>)

Sets the set_client_id field.

source

pub fn set_username(&mut self, username: Option<String>)

Sets the set_username field.

source

pub fn set_token_type(&mut self, token_type: Option<TT>)

Sets the set_token_type field.

source

pub fn set_exp(&mut self, exp: Option<DateTime<Utc>>)

Sets the set_exp field.

source

pub fn set_iat(&mut self, iat: Option<DateTime<Utc>>)

Sets the set_iat field.

source

pub fn set_nbf(&mut self, nbf: Option<DateTime<Utc>>)

Sets the set_nbf field.

source

pub fn set_sub(&mut self, sub: Option<String>)

Sets the set_sub field.

source

pub fn set_aud(&mut self, aud: Option<Vec<String>>)

Sets the set_aud field.

source

pub fn set_iss(&mut self, iss: Option<String>)

Sets the set_iss field.

source

pub fn set_jti(&mut self, jti: Option<String>)

Sets the set_jti field.

source

pub fn extra_fields(&self) -> &EF

Extra fields defined by the client application.

source

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>
where EF: Clone + ExtraTokenFields, TT: Clone + TokenType + 'static,

source§

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)

Performs copy-assignment from source. Read more
source§

impl<EF, TT> Debug for StandardTokenIntrospectionResponse<EF, TT>
where EF: Debug + ExtraTokenFields, TT: Debug + TokenType + 'static,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de, EF, TT> Deserialize<'de> for StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType + 'static,

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<StandardTokenIntrospectionResponse<EF, TT>, <__D as Deserializer<'de>>::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,

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<EF, TT> TokenIntrospectionResponse<TT> for StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType,

source§

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>>

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>

OPTIONAL. Client identifier for the OAuth 2.0 client that requested this token.
source§

fn username(&self) -> Option<&str>

OPTIONAL. Human-readable identifier for the resource owner who authorized this token.
source§

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>>

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>>

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>>

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>

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>>

OPTIONAL. Service-specific string identifier or list of string identifiers representing the intended audience for this token, as defined in JWT RFC7519.
source§

fn iss(&self) -> Option<&str>

OPTIONAL. String representing the issuer of this token, as defined in JWT RFC7519.
source§

fn jti(&self) -> Option<&str>

OPTIONAL. String identifier for the token, as defined in JWT RFC7519.

Auto Trait Implementations§

§

impl<EF, TT> RefUnwindSafe for StandardTokenIntrospectionResponse<EF, TT>

§

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§

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> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,