[−][src]Struct tokkit::TokenInfo
Information on an AccessToken
returned by a TokenInfoService
.
Fields
active: 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). See Section 4 for information on implementation of such checks.
user_id: Option<UserId>
OPTIONAL. Human-readable identifier for the resource owner who authorized this token.
Remark: This is usually not a human readable id but a custom field since we are in the realm of S2S authorization.
scope: 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 OAuth 2.0 RFC6749.
expires_in_seconds: Option<u64>
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.
Remark: Contains the number of seconds until the token expires. This seems to be used by most introspection services.
Methods
impl TokenInfo
[src]
pub fn has_scope(&self, scope: &Scope) -> bool
[src]
Use for authorization. Checks whether this TokenInfo
has the given
Scope
.
pub fn has_scopes(&self, scopes: &[Scope]) -> bool
[src]
Use for authorization. Checks whether this TokenInfo
has all of the
given Scopes
.
pub fn must_have_scope(&self, scope: &Scope) -> Result<(), NotAuthorized>
[src]
If the TokenInfo
does not have the scope this method will fail.
Trait Implementations
impl PartialEq<TokenInfo> for TokenInfo
[src]
impl Debug for TokenInfo
[src]
impl StructuralPartialEq for TokenInfo
[src]
Auto Trait Implementations
impl Send for TokenInfo
impl Sync for TokenInfo
impl Unpin for TokenInfo
impl UnwindSafe for TokenInfo
impl RefUnwindSafe for TokenInfo
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,