Config & auth¶
barbara.config.BarbaraConfig
dataclass
¶
BarbaraConfig(
client_id: str,
client_secret: Optional[str],
username: str,
password: str,
api_url: str = DEFAULT_API_URL,
auth_url: str = DEFAULT_AUTH_URL,
realm: str = DEFAULT_REALM,
verify_tls: bool = True,
)
client_secret and password are excluded from repr() —
dataclasses print every field by default, and this object (or the
client holding it, via client.config) can end up in a log line, a
traceback, or a debugger without anyone intending to print a secret.
from_env
classmethod
¶
from_env() -> BarbaraConfig
Build config from environment variables, raising on missing credentials.
barbara.auth.TokenManager ¶
TokenManager(config: BarbaraConfig, http_client: Client)
Sync token fetch/refresh. Not thread-safe by design (kept simple).
barbara.auth.AsyncTokenManager ¶
AsyncTokenManager(
config: BarbaraConfig, http_client: AsyncClient
)
Async counterpart of :class:TokenManager.