- Updated the .env.example file to reflect a development environment setup with enhanced secret key requirements and local host settings. - Modified the Docker Compose configuration to enhance security with read-only settings and no-new-privileges options. - Updated requirements.txt to pin package versions for better dependency management. - Enhanced the FastAPI application to include dynamic OpenAPI and documentation URLs based on the environment. - Implemented session versioning in JWT tokens to improve security and user session management. - Added new validation for user roles and password strength in schemas. - Improved email sending logic to handle recipient lists more robustly and added logging for SMTP operations. - Updated dashboard and profile templates to reflect new features and improve user experience.
18 lines
735 B
Python
18 lines
735 B
Python
from sqlalchemy import Boolean, Column, DateTime, Integer, String, func
|
|
|
|
from app.db.session import Base
|
|
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
email = Column(String(255), unique=True, index=True, nullable=False)
|
|
full_name = Column(String(255), nullable=False)
|
|
password_hash = Column(String(255), nullable=False)
|
|
is_admin = Column(Boolean, default=False, nullable=False)
|
|
role = Column(String(32), default="reader", nullable=False)
|
|
is_active = Column(Boolean, default=True, nullable=False)
|
|
session_version = Column(Integer, default=0, nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
|