Files
MediaManager/media_manager/auth/config.py
Maximilian Dorninger a39e0d204a Ruff enable type annotations rule (#362)
This PR enables the ruff rule for return type annotations (ANN), and
adds the ty package for type checking.
2026-01-06 17:07:19 +01:00

23 lines
584 B
Python

import secrets
from pydantic import Field
from pydantic_settings import BaseSettings
class OpenIdConfig(BaseSettings):
client_id: str = ""
client_secret: str = ""
configuration_endpoint: str = ""
enabled: bool = False
name: str = "OAuth2"
class AuthConfig(BaseSettings):
# to get a signing key run:
# openssl rand -hex 32
token_secret: str = Field(default_factory=secrets.token_hex)
session_lifetime: int = 60 * 60 * 24
admin_emails: list[str] = []
email_password_resets: bool = False
openid_connect: OpenIdConfig = OpenIdConfig()