pub struct Claims {
pub subject: String,
pub issued_at: u32,
pub expires_at: u32,
pub audience: String,
pub roles: Vec<Role>,
pub scopes: Vec<Scope>,
pub jti: Uuid,
}Expand description
The validated, decoded claims from a KWT token. All fields that appear in the binary format are represented here.
fmt::Debug is redacted (lengths only for strings, no jti value) so
println!("{claims:?}") in servers does not leak identifiers into logs.
Fields§
§subject: StringSubject identifier. Alphanumeric, max MAX_SUBJECT_BYTES UTF-8 bytes.
issued_at: u32Unix timestamp (seconds) when the token was issued.
expires_at: u32Unix timestamp (seconds) after which the token must be rejected.
audience: StringIntended audience. Must exactly match the server’s registered audience (max
MAX_AUDIENCE_BYTES UTF-8 bytes).
roles: Vec<Role>Authorization roles granted to this token.
scopes: Vec<Scope>API scopes granted to this token.
jti: UuidJWT ID — UUID v7 for replay detection.
Implementations§
Trait Implementations§
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
Mutably borrows from an owned value. Read more