This repository has been archived on 2020-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
statuspage/app/settings/globals.py
surtur 927bdd03ce
feat: added JWT-based authentication; introduced config file
* authorization [WIP]
* refactored several sections
* used dict(exclude_unset=True)
* global values are now sourced from a config file (statuspagerc)
2020-08-11 11:48:46 +02:00

20 lines
434 B
Python

from pathlib import Path
from typing import Optional
from starlette.config import Config
p: Path = Path(__file__).parents[2] / "statuspagerc"
config: Config = Config(p if p.exists() else None)
DATABASE: str = config("DATABASE", cast=str)
ALEMBIC_CONFIG: str = (
DATABASE
)
JWT_SECRET: str = config("JWT_SECRET", cast=str)
JWT_ALGORITHM: str = config("JWT_ALGORITHM", cast=str)
JWT_EXPIRY: int = config("JWT_EXPIRY", cast=int)