32 lines
997 B
Python
32 lines
997 B
Python
from pathlib import Path
|
|
from typing import List
|
|
|
|
from pydantic import BaseModel, Field
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
directory: Path = Field(default=Path.cwd() / "data")
|
|
uploads_directory: Path = Field(default=Path.cwd() / "uploads")
|
|
oidc_authorize_url: str = Field()
|
|
oidc_token_url: str = Field()
|
|
oidc_jwks_url: str = Field()
|
|
oidc_permitted_jwt_audiences: List[str] = Field()
|
|
oidc_client_id: str = Field()
|
|
oidc_sub_jwt_attribute: str = Field(default="sub")
|
|
oidc_name_jwt_attribute: str = Field(default="name")
|
|
oidc_scopes: List[str] = Field(
|
|
default=["openid", "email", "profile", "offline_access"]
|
|
)
|
|
oidc_authority: str = Field()
|
|
|
|
model_config = SettingsConfigDict(env_nested_delimiter="__", env_prefix="PG_")
|
|
|
|
|
|
class AppConfig(BaseModel):
|
|
oidc_authority: str = Field()
|
|
oidc_client_id: str = Field()
|
|
oidc_scopes: List[str] = Field()
|
|
|
|
|
|
settings = Settings()
|