Security
jwtlib.models.security
JWT token payload models.
This module defines typed representations of decoded JWT payloads used internally for token validation and user resolution.
TokenPayload
Bases: BaseModel
Decoded JWT payload.
Represents the validated claims extracted from a JWT after signature verification. This model is used internally to enforce required claims and provide a typed interface to token data.
Fields
sub: Subject claim identifying the user (typically a username or user ID). exp: Expiration time as a Unix timestamp (seconds since epoch).
Notes
- This model assumes the JWT signature has already been verified.
- No authorization decisions should be made solely on this model.
- Additional claims may exist but are intentionally ignored.