-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
64 lines (52 loc) · 1.41 KB
/
config.py
File metadata and controls
64 lines (52 loc) · 1.41 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="forbid",
)
# APP
APP_ENV: str
APP_NAME: str
# DATABASE
POSTGRES_DB: str
POSTGRES_USER: str
POSTGRES_PASSWORD: str
POSTGRES_HOST: str
POSTGRES_PORT: str
@property
def DATABASE_URL(self) -> str:
return (
f"postgresql+asyncpg://"
f"{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}"
f"@{self.POSTGRES_HOST}:{self.POSTGRES_PORT}"
f"/{self.POSTGRES_DB}"
)
@property
def LOCAL_DATABASE_URL(self) -> str:
return (
f"postgresql+asyncpg://"
f"{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}"
f"@localhost:{self.POSTGRES_PORT}"
f"/{self.POSTGRES_DB}"
)
# JWT / AUTH
JWT_SECRET: str
JWT_ALG: str = "HS256"
ACCESS_TOKEN_MINUTES: int = 30
REFRESH_TOKEN_DAYS: int = 14
# SECURITY
PASSWORD_HASH_ROUNDS: int = 12
# CORS
CORS_ORIGINS: str = ""
# LOGGING
LOG_LEVEL: str = "INFO"
# Oracle Cloud Storage
OCI_USER_OCID: str
OCI_API_KEY_PATH: str
OCI_FINGERPRINT: str
OCI_TENANCY_OCID: str
OCI_REGION: str
OCI_OBJECT_STORAGE_NAMESPACE: str
OCI_OBJECT_STORAGE_BUCKET: str
settings = Settings()