Skip to content

Mongo

jwtlib.models.mongo

Persistence-layer user model.

This module defines the internal database representation of a user. It is used exclusively by the repository and persistence layers and must never be exposed directly to consumers.

Public-facing user data is provided via dedicated projection models.

User

Bases: BaseDocument, IdentityMixin, ActiveStateMixin

Internal user persistence model.

Represents a user record as stored in the database. This model includes sensitive fields and is strictly confined to the persistence layer.

Fields

hashed_password: Secure hash of the user's password.

Notes
  • This model MUST NOT be returned from authentication APIs.
  • Consumers should use PublicUser instead.
  • Password verification is handled by the repository layer.
  • Inherits identity and active-state behavior via mixins.