File size: 616 Bytes
67aa1ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Modelo de dominio: Usuario (autenticación)."""

from __future__ import annotations

from datetime import datetime

from pydantic import EmailStr, Field

from app.models.common import MongoModel


class User(MongoModel):
    """Usuario administrador del directorio.

    El campo ``hashed_password`` nunca debe exponerse en las respuestas
    de la API; para ello se utilizan los esquemas de :mod:`app.schemas.auth`.
    """

    username: str = Field(min_length=3, max_length=50)
    email: EmailStr
    hashed_password: str
    is_active: bool = True
    is_superuser: bool = False
    fecha_creacion: datetime