Spaces:
Sleeping
Sleeping
Download src/config.py from hashir-qt/keyvault-api: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/hashir-qt/keyvault-api/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/hashir-qt/keyvault-api/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/hashir-qt/keyvault-api/resolve/main/src/config.py
1.14 kB
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| from typing import Literal | |
| class Settings(BaseSettings): | |
| """Application configuration loaded from environment variables.""" | |
| model_config = SettingsConfigDict( | |
| env_file=".env", | |
| env_file_encoding="utf-8", | |
| case_sensitive=False, | |
| ) | |
| # Database | |
| database_url: str # postgresql+asyncpg://user:pass@host/db | |
| # JWT | |
| jwt_secret: str | |
| jwt_algorithm: str = "HS256" | |
| jwt_expiry_hours: int = 24 | |
| # Encryption (for product keys) | |
| encryption_key: str | |
| # Payments | |
| crypto_processor: Literal["mock", "coinbase", "nowpayments"] = "mock" | |
| crypto_api_key: str = "" | |
| crypto_webhook_secret: str = "" | |
| # App | |
| app_env: Literal["development", "staging", "production"] = "development" | |
| debug: bool = True | |
| allowed_origins: str = "http://localhost:3000" | |
| def cors_origins(self) -> list[str]: | |
| """Parse comma-separated ALLOWED_ORIGINS into a list.""" | |
| return [o.strip() for o in self.allowed_origins.split(",")] | |
| settings = Settings() | |