Skip to content

common_auth.schemas.credentials.configs

Consumer configuration for one supplied or referenced credential binding.

Construction validates inputs only. Source connections are separately configured and injected into runtime classes; no environment, source or database is read. Resolution deadlines, type checks, expiry and cache behavior are runtime duties.

Classes

CredentialConfig

Bases: BaseModel

One credential’s input and reference-resolution policy.

Supply material directly or a CredentialRef naming an explicitly configured source. Material is already typed/protected by the existing contracts. Source implementations and connections are runtime dependencies, not fields.

resolve_timeout_sec bounds reference resolution; None disables that extra deadline. cache_ttl_sec applies only to reference lookup: zero disables caching; positive retention must also respect any source-provided expiry. Supplied material remains the explicitly supplied value, without lookups.

Standard dumps omit nested secrets and cannot serve as secret backups. merge() preserves actual contract objects and validates a replacement config. It replaces credential values as a whole; it never patches secret material using a display dump. None is explicit, not an instruction to skip an update.

Fields and properties declared here; inherited members belong to the bases above.

cache_ttl_sec

cache_ttl_sec: float = Field(default=0.0, ge=0, allow_inf_nan=False)

credential

credential: Credential | CredentialRef = Field(repr=False)

resolve_timeout_sec

resolve_timeout_sec: float | None = Field(default=30.0, gt=0, allow_inf_nan=False)

merge

def merge(**overrides: object) -> Self

Return a validated replacement; preserve untouched credential objects.