"""Service configuration. Every value is settable from the environment so the container needs no config file. `database_url` has no default on purpose: a service that silently falls back to a local database when its real one is misconfigured is worse than one that refuses to start. """ from __future__ import annotations from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): model_config = SettingsConfigDict(env_prefix="CANNED_PROMPTS_", extra="ignore") database_url: str = "" tenant: str = "default" service_name: str = "canned-prompts" # A single shared token, so the identity it proves is "the operator of this # service" and nothing finer. Unset means the service is read-only; see # auth.py for why that is the right default rather than an inconvenience. publish_token: str = "" publisher_name: str = "operator" @property def configured(self) -> bool: return bool(self.database_url) def get_settings() -> Settings: return Settings()