File size: 1,564 Bytes
609d292 2a99443 8eb630b 2a99443 609d292 0743ddc 8eb630b 0743ddc 8eb630b 609d292 8eb630b 0743ddc 8eb630b 0743ddc 8eb630b 0743ddc 8eb630b 0743ddc 8eb630b 2a99443 0743ddc 579285c 8eb630b 0743ddc 8eb630b 609d292 579285c 8eb630b | 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 | """
Settings bridge - delegates to core.config.Settings
This module provides backward compatibility for code using shared.settings.
All settings should be accessed via core.config.Settings.
"""
from functools import lru_cache
try:
from core.config import Settings
from core.config import get_settings as _get_settings
@lru_cache
def get_settings() -> Settings:
"""Get application settings (cached)"""
return _get_settings()
except ImportError:
# Fallback for testing/minimal environments
import warnings
warnings.warn("core.config.Settings not available, using stub settings", RuntimeWarning)
class SecurityConfig:
"""Stub security config for testing"""
secret_key: str = "dev-secret-key-change-in-production"
jwt_expire_minutes: int = 30
jwt_refresh_expire_days: int = 7
class AppConfig:
"""Stub app config for testing"""
environment: str = "development"
log_level: str = "INFO"
class Settings: # type: ignore[call-arg, call-overload, no-redef]
"""Fallback stub settings"""
def __init__(self):
self.database_url = "sqlite:///./data/databases/test/test.db"
self.async_database_url = "sqlite+aiosqlite:///./data/databases/test/test.db"
self.redis_url = "redis://localhost:6379"
self.security = SecurityConfig()
self.app = AppConfig()
def get_settings(): # type: ignore[attr-defined, misc, dict-item, abstract, type-var, union-attr]
return Settings()
|