-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.py
More file actions
39 lines (30 loc) · 1.29 KB
/
config.py
File metadata and controls
39 lines (30 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from typing import Dict, Literal, Optional
from pydantic import BaseModel, Field
from pydantic_settings import BaseSettings, SettingsConfigDict
from sqlalchemy_bind_manager import SQLAlchemyConfig
TYPE_ENVIRONMENT = Literal["local", "test", "staging", "production"]
class DramatiqConfig(BaseModel):
REDIS_URL: Optional[str] = None
class AuthConfig(BaseModel):
JWT_ALGORITHM: str = "RS256"
JWKS_URL: Optional[str] = None
class AppConfig(BaseSettings):
model_config = SettingsConfigDict(env_nested_delimiter="__")
APP_NAME: str = "bootstrap"
CORS_ORIGINS: list[str] = Field(default_factory=list)
CORS_METHODS: list[str] = ["*"]
CORS_HEADERS: list[str] = ["*"]
AUTH: AuthConfig = AuthConfig()
DRAMATIQ: DramatiqConfig = DramatiqConfig()
DEBUG: bool = False
ENVIRONMENT: TYPE_ENVIRONMENT = "local"
SQLALCHEMY_CONFIG: Dict[str, SQLAlchemyConfig] = dict(
default=SQLAlchemyConfig(
engine_url="mysql+asyncmy://corinna:gioieiiere@127.0.0.1/backend?charset=utf8mb4",
async_engine=True,
),
)
OTEL_EXPORTER_OTLP_ENDPOINT: Optional[str] = None
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: Optional[str] = None
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: Optional[str] = None
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: Optional[str] = None