- Remove global Nextcloud settings from config - Make NextcloudClient require explicit credentials - Update for_member() to return None when no credentials - Modify services to accept optional storage client - Update routers to pass member storage to services - Add 403 responses when no storage provider configured - Update internal endpoints to use member storage credentials This change enforces that each member must configure their own Nextcloud storage provider. If no provider is configured, file operations will return 403 FORBIDDEN instead of falling back to global placeholders.
31 lines
725 B
Python
31 lines
725 B
Python
from functools import lru_cache
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
|
|
|
# Security
|
|
secret_key: str
|
|
jwt_algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 60 * 24 * 7 # 7 days
|
|
|
|
# Database
|
|
database_url: str # postgresql+asyncpg://...
|
|
|
|
# Redis
|
|
redis_url: str = "redis://localhost:6379/0"
|
|
job_queue_key: str = "rh:jobs"
|
|
|
|
# App
|
|
domain: str = "localhost"
|
|
debug: bool = False
|
|
|
|
# Worker
|
|
analysis_version: str = "1.0.0"
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings() # type: ignore[call-arg]
|