feat: Two-Factor Authentication (TOTP, Email OTP) and OIDC/SSO – full implementation with admin UI (#933)

feat: Two-Factor Authentication (TOTP, Email OTP) and OIDC/SSO – full implementation with admin UI (#933)
This commit is contained in:
Sn0rrii
2026-04-13 13:24:28 +02:00
committed by GitHub
parent 8af0966e68
commit ba1c97c808
44 changed files with 10473 additions and 290 deletions
+5 -1
View File
@@ -30,11 +30,15 @@ class User(Base):
role: Mapped[str] = mapped_column(
String(20), default="user"
) # "admin" or "user" (legacy, kept for backward compat)
auth_source: Mapped[str] = mapped_column(String(20), default="local") # "local" or "ldap"
auth_source: Mapped[str] = mapped_column(String(20), default="local") # "local", "ldap", or "oidc"
is_active: Mapped[bool] = mapped_column(default=True)
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
updated_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(), onupdate=func.now())
# Set whenever the local password is changed/reset — used to invalidate JWTs
# issued before the change (M-R7-B). NULL means no password change recorded yet.
password_changed_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
# Per-user Bambu Cloud credentials (when auth is enabled, each user has their own)
cloud_token: Mapped[str | None] = mapped_column(String(500), nullable=True, default=None)
cloud_email: Mapped[str | None] = mapped_column(String(255), nullable=True, default=None)