Common
jwtlib.models.common
Common Pydantic mixins for authentication models.
Summary
This module provides reusable mixins for identity, password, and account state. These mixes ensure consistency across internal persistence models and public-facing projection models.
Classes
ActiveStateMixin
Bases: BaseModel
Mixin for entities with an active status flag.
Attributes:
| Name | Type | Description |
|---|---|---|
is_active |
bool
|
Indicates whether the account is active and allowed to authenticate. |
IdentityMixin
Bases: BaseModel
Mixin for entities with a username and email.
Attributes:
| Name | Type | Description |
|---|---|---|
username |
str
|
Unique username used for authentication and display. |
email |
Optional[EmailStr]
|
Primary email address associated with the account. |
PasswordMixin
Bases: BaseModel
Mixin for entities with a raw password field.
Attributes:
| Name | Type | Description |
|---|---|---|
password |
str
|
User password (minimum 6 characters). |