feat: magic-link auth with access requests and RBAC

This commit is contained in:
Jonas Miederer 2026-09-11 17:27:58 +02:00
parent c2125f063b
commit c8280f7078
13 changed files with 1058 additions and 2 deletions

View file

@ -14,7 +14,9 @@ class Settings(BaseSettings):
debug: bool = False
# App database (SQLite file). Override via DATABASE_URL for other engines.
database_url: str = str(REPO_ROOT / "backend" / "data" / "kirche.db")
# Must be a URL (not a bare path): db.py and Alembic hand it to
# create_engine, which rejects bare paths.
database_url: str = f"sqlite:///{REPO_ROOT / 'backend' / 'data' / 'kirche.db'}"
# Canonical flow definitions (source of truth): one Langflow export per file.
flows_dir: str = str(REPO_ROOT / "backend" / "flows")
@ -30,5 +32,24 @@ class Settings(BaseSettings):
# FROM the LFX process (compose: http://api:8000).
callback_base_url: str = "http://localhost:8000"
# --- access management (magic-link auth, see app/auth) ---
# Public frontend URL (magic links point at /login?token= there).
frontend_url: str = "http://localhost:3000"
# Comma-separated emails that become admins (role assignment + bootstrap).
admin_emails: str = ""
# Reply-To on outgoing mail; also receives access-request notifications.
contact_to: str = ""
mail_from: str = ""
smtp_host: str = ""
smtp_port: int = 587
smtp_username: str = ""
smtp_password: str = ""
@property
def admin_email_list(self) -> list[str]:
return [
e.strip().lower() for e in self.admin_emails.split(",") if e.strip()
]
settings = Settings()