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)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Claims
impl<'de> Deserialize<'de> for Claims
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>,
Auto Trait Implementations§
impl Freeze for Claims
impl RefUnwindSafe for Claims
impl Send for Claims
impl Sync for Claims
impl Unpin for Claims
impl UnsafeUnpin for Claims
impl UnwindSafe for Claims
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
x-request-id as the header name. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
413 Payload Too Large responses. Read more