pub struct Claims {
pub issuer: String,
pub subject: Uuid,
pub audiences: Vec<String>,
pub expires_at: Option<OffsetDateTime>,
pub not_before: Option<OffsetDateTime>,
pub issued_at: Option<OffsetDateTime>,
pub jwt_id: Option<String>,
pub tenant_id: Uuid,
pub permissions: Vec<Permission>,
pub extras: Map<String, Value>,
}Expand description
JWT claims representation that’s provider-agnostic
Fields§
§issuer: StringIssuer - the iss claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.1
subject: UuidSubject - the sub claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2
audiences: Vec<String>Audiences - the aud claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3
expires_at: Option<OffsetDateTime>Expiration time - the exp claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
not_before: Option<OffsetDateTime>Not before time - the nbf claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5
issued_at: Option<OffsetDateTime>Issued At - the iat claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6
jwt_id: Option<String>JWT ID - the jti claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7
tenant_id: UuidTenant ID - the tenant_id claim
permissions: Vec<Permission>User roles
extras: Map<String, Value>Additional provider-specific claims
Implementations§
Source§impl Claims
impl Claims
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the token has expired
Sourcepub fn is_valid_yet(&self) -> bool
pub fn is_valid_yet(&self) -> bool
Check if the token is valid yet (nbf check)