- FastAPI 백엔드 + MongoDB + Redis 구성 - React + Vite + TypeScript + shadcn/ui 프론트엔드 - Apache APISIX API Gateway 통합 - Docker Compose 기반 개발 환경 - 3단계 권한 체계 (System Admin, Group Admin, User) - 동적 테마 지원 - 환경별 설정 (dev/vei/prod) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
from typing import List, Union
|
|
from pydantic_settings import BaseSettings
|
|
from pydantic import field_validator
|
|
import os
|
|
|
|
class Settings(BaseSettings):
|
|
PROJECT_NAME: str = "OAuth Authentication System"
|
|
VERSION: str = "1.0.0"
|
|
API_V1_STR: str = "/api/v1"
|
|
|
|
SECRET_KEY: str = os.getenv("SECRET_KEY", "0198fda4-294e-77b0-a95d-2b601d2c594d")
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
REFRESH_TOKEN_EXPIRE_DAYS: int = 7
|
|
|
|
MONGODB_URL: str = os.getenv("MONGODB_URL", "mongodb://localhost:27017")
|
|
DATABASE_NAME: str = os.getenv("DATABASE_NAME", "oauth_db")
|
|
|
|
REDIS_URL: str = os.getenv("REDIS_URL", "redis://localhost:6379")
|
|
|
|
BACKEND_CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:5173"]
|
|
|
|
ENVIRONMENT: str = os.getenv("ENVIRONMENT", "dev")
|
|
|
|
BACKUP_PATH: str = os.getenv("BACKUP_PATH", "/var/backups/oauth")
|
|
ARCHIVE_PATH: str = os.getenv("ARCHIVE_PATH", "/var/archives/oauth")
|
|
|
|
SMTP_HOST: str = os.getenv("SMTP_HOST", "")
|
|
SMTP_PORT: int = int(os.getenv("SMTP_PORT", "587"))
|
|
SMTP_USER: str = os.getenv("SMTP_USER", "")
|
|
SMTP_PASSWORD: str = os.getenv("SMTP_PASSWORD", "")
|
|
|
|
NEXUS_URL: str = os.getenv("NEXUS_URL", "")
|
|
NEXUS_REPOSITORY: str = os.getenv("NEXUS_REPOSITORY", "")
|
|
|
|
@field_validator("BACKEND_CORS_ORIGINS", mode="before")
|
|
@classmethod
|
|
def assemble_cors_origins(cls, v: Union[str, List[str]]) -> Union[List[str], str]:
|
|
if isinstance(v, str) and not v.startswith("["):
|
|
return [i.strip() for i in v.split(",")]
|
|
elif isinstance(v, (list, str)):
|
|
return v
|
|
raise ValueError(v)
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
settings = Settings() |