aeat.application.auth._certificate_sources_operator module¶
Operator-facing certificate-source registry verbs for the config CLI.
Wraps the pure _certificate_sources state
transformations with the same active-bucket gating, secure-object
persistence, and typed bucket-event emission that
configure_operator_auth() uses, so registering,
listing, selecting, or removing a named certificate source is exposed
through aeat config auth certificate ... with identical safety
guarantees.
check_operator_certificate_sources() extends the registry with
expiry/rotation awareness: it re-runs the same local PKCS#12 health
probe the single-certificate auth test path already performs
(_operator_probes) against every registered
source rather than only the active certificate_path, so a gestor
managing several apoderado certificates gets a renewal reminder for
each one individually.
See also
_certificate_sourcesPure
WorkflowStatetransformations this module persists.configure_operator_auth()Sibling operator verb configuring the active auth provider; this module manages named certificate sources within the certificate provider.
probe_provider_configuration()Sibling single-certificate expiry probe this module’s
check_operator_certificate_sources()reuses per named source.
- register_operator_certificate_source(*, name, certificate_path, friendly_name=None)[source]¶
Register (or re-point) a named certificate source for the active profile.
- Raises:
AuthConfigureNoActiveBucketError – When no active profile bucket exists yet.
AuthConfigureDanglingActiveProfileError – When the active-profile pointer does not resolve to a registered bucket.
- Return type:
- Returns:
- Parameters:
- list_operator_certificate_sources()[source]¶
Return every registered certificate source for the active profile.
- Return type:
- Returns:
- select_operator_certificate_source(*, name)[source]¶
Mark
namethe active certificate source for the active profile.Selecting a source mirrors its path onto
AuthState.certificate_pathso every existing certificate-provider consumer (the backend health probe, live login preconditions,auth status/auth test) reads the newly selected source without further changes.- Raises:
AuthConfigureNoActiveBucketError – When no active profile bucket exists yet.
AuthConfigureDanglingActiveProfileError – When the active-profile pointer does not resolve to a registered bucket.
CertificateSourceNotFoundError – When
nameis not registered.
- Return type:
- Returns:
- Parameters:
name (str)
- remove_operator_certificate_source(*, name)[source]¶
Remove the named certificate source from the active profile’s registry.
A
namethat is not registered is a no-op (removed=False), not an error, matching the idempotent-removal convention used elsewhere in the auth surface.- Raises:
AuthConfigureNoActiveBucketError – When no active profile bucket exists yet.
AuthConfigureDanglingActiveProfileError – When the active-profile pointer does not resolve to a registered bucket.
- Return type:
- Returns:
- Parameters:
name (str)
- check_operator_certificate_sources(*, settings=None)[source]¶
Classify expiry/rotation health for every registered certificate source.
Reuses the same local PKCS#12 probe (
_probe_certificate_bundle()) the single-certificateauth testpath already runs — classifyingok/expiring/expired/corrupt/unreadable/file_missing— but applies it to every named source in the registry rather than only the activecertificate_path. A gestor with several apoderado certificates therefore gets one renewal reminder per entity, not only for whichever certificate happens to be selected.Each source’s passphrase resolves through
resolve_certificate_source_secret()first (the per-sourceCertificateSecretBackend); when no per-source secret is registered, the probe falls back to the shared, env-onlyaeat_certificate_password_secret— preserving the pre-registry single-certificate contract for sources that never adopted a per-source secret.This is a pure read: it does not require an active profile bucket beyond what loading workflow state needs, and it never mutates state or emits a bucket event.
- Return type:
- Returns:
A
CertificateSourceCheckReportwith oneCertificateSourceCheckEntryper registered source, sorted by name (matchinglist_operator_certificate_sources()).- Parameters:
settings (Settings | None)
- resolve_certificate_source_secret(*, name, bucket_id, backend_kind=CertificateSecretBackendKind.SECURE_STORAGE)[source]¶
Return the passphrase registered for certificate source
name, orNone.Reads through
certificate_secret_backend()scoped tobucket_id; never falls back to a global setting itself — callers that also want the legacyaeat_certificate_password_secretfallback (single-certificate, pre-registry contract) compose that fallback explicitly, keeping the precedence visible at the call site rather than hidden inside this resolver.- Return type:
SecretStr|None- Parameters:
name (str)
bucket_id (str)
backend_kind (CertificateSecretBackendKind)
- set_operator_certificate_source_secret(*, name, secret, backend_kind=CertificateSecretBackendKind.SECURE_STORAGE)[source]¶
Set (or rotate) the passphrase for a registered certificate source.
The named source MUST already be registered (
register_operator_certificate_source()) — a secret is bound to an existing source, never freestanding. The secret itself is never persisted toWorkflowStateor emitted in the mutation result; only whether one is now present and which backend holds it.- Raises:
AuthConfigureNoActiveBucketError – When no active profile bucket exists yet.
AuthConfigureDanglingActiveProfileError – When the active-profile pointer does not resolve to a registered bucket.
CertificateSourceNotFoundError – When
nameis not registered.
- Return type:
- Returns:
- Parameters:
name (str)
secret (SecretStr)
backend_kind (CertificateSecretBackendKind)
- remove_operator_certificate_source_secret(*, name, backend_kind=CertificateSecretBackendKind.SECURE_STORAGE)[source]¶
Remove the persisted passphrase for a registered certificate source.
A
namewith no registered secret is a no-op (removed=False), matching the idempotent-removal convention used elsewhere on the auth surface.- Raises:
AuthConfigureNoActiveBucketError – When no active profile bucket exists yet.
AuthConfigureDanglingActiveProfileError – When the active-profile pointer does not resolve to a registered bucket.
- Return type:
- Returns:
- Parameters:
name (str)
backend_kind (CertificateSecretBackendKind)