Skip to content

Mongo

jwtlib.models.mongo

Summary

Persistence-layer user model for MongoDB.

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.

Classes

User

Bases: BaseDocument, IdentityMixin, ActiveStateMixin

Internal user persistence model.

Attributes:

Name Type Description
hashed_password str

Secure hash of the user's password.

Notes

Responsibilities:

1
2
3
- Represents a user record as stored in the database. Includes
  sensitive fields and is strictly confined to the persistence
  layer.

Guarantees:

1
2
3
- This model MUST NOT be returned from authentication APIs.
  Consumers should use `PublicUser` instead. Password verification
  is handled by the repository layer.