first commit - MVE Incrementables Parser microservice with FastAPI, JWT, Celery, Redis
This commit is contained in:
39
app/core/config.py
Normal file
39
app/core/config.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""Configuration management using Pydantic Settings."""
|
||||
from pydantic_settings import BaseSettings
|
||||
from functools import lru_cache
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Application settings loaded from environment variables."""
|
||||
|
||||
# Service Info
|
||||
service_name: str = "mve-incrementables-parser"
|
||||
service_version: str = "1.0.0"
|
||||
|
||||
# Authentication
|
||||
auth_username: str
|
||||
auth_password_hash: str
|
||||
jwt_secret: str
|
||||
jwt_expires_minutes: int = 60
|
||||
jwt_algorithm: str = "HS256"
|
||||
|
||||
# File Upload
|
||||
max_file_mb: int = 10
|
||||
|
||||
# Logging
|
||||
log_level: str = "INFO"
|
||||
|
||||
# Redis/Celery
|
||||
redis_url: str = "redis://localhost:6379/0"
|
||||
celery_broker_url: str = "redis://localhost:6379/0"
|
||||
celery_result_backend: str = "redis://localhost:6379/0"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
case_sensitive = False
|
||||
|
||||
|
||||
@lru_cache()
|
||||
def get_settings() -> Settings:
|
||||
"""Get cached settings instance."""
|
||||
return Settings()
|
||||
Reference in New Issue
Block a user