cadrumo.application.auth.operator_probes module¶
Local auth provider and persisted-session probes for operator services.
The local probe path classifies AuthProviderKind configuration with
ProviderProbeResult values and reuses persisted-session metadata via
load_persisted_session().
- classify_identity_alignment(profile_tax_id, provider_identity)[source]¶
Classify a Cl@ve Móvil identity against the active profile tax id.
The single home for the five-way alignment ladder shared by the live identity-state probe and
_auth_configure_result. Inputs are the already-normalised (stripped, upper-cased) tax id and provider identity.
- probe_clave_credentials(provider_kind, *, settings, state=None, operator_probe_ports)[source]¶
Resolve the credentials a readiness probe should report on.
Routes through the same resolver the live session entry uses, so a surface cannot report a credential as unconfigured that the session entry would authenticate with. Unlike the session entry this never refuses: an absent credential is the state being reported, not a fault.
- Return type:
- Parameters:
provider_kind (AuthProviderKind | None)
settings (Settings)
state (WorkflowState | None)
operator_probe_ports (OperatorProbePorts)
- bind_profile_auth_settings(provider_kind, *, settings, state=None, operator_probe_ports)[source]¶
Bind the profile credentials that the selected backend will actually use.
Status and live authentication must construct a provider from the same effective settings. This uses the live session resolver and binder rather than reproducing their precedence rules in a readiness-only projection.
- Return type:
- Parameters:
provider_kind (AuthProviderKind | None)
settings (Settings)
state (WorkflowState | None)
operator_probe_ports (OperatorProbePorts)
- live_auth_identity_state(provider_kind, *, settings, state=None, operator_probe_ports)[source]¶
Project whether the configured live-auth identity is usable.
- Return type:
- Parameters:
provider_kind (AuthProviderKind | None)
settings (Settings)
state (WorkflowState | None)
operator_probe_ports (OperatorProbePorts)
- live_auth_identity_kind(provider_kind, *, settings, state=None, operator_probe_ports)[source]¶
Return the safe identity-kind label for the configured provider.
- Return type:
- Parameters:
provider_kind (AuthProviderKind | None)
settings (Settings)
state (WorkflowState | None)
operator_probe_ports (OperatorProbePorts)
- live_auth_mode(provider_kind, *, settings)[source]¶
Project the configured interactive mode without acquiring a session.
- Return type:
- Parameters:
provider_kind (AuthProviderKind | None)
settings (Settings)
- probe_local_session(provider, *, settings=None, operator_scope_ports)[source]¶
Inspect the persisted AEAT session token for
provideron disk.A pure local read — it never opens a browser or contacts AEAT. It answers the question
auth statuscannot: is there actually a usable session token on disk for this provider right now.- Return type:
_LocalSessionProbe- Parameters:
provider (str)
settings (Settings | None)
operator_scope_ports (OperatorScopePorts)
- class ProviderConfigurationProbe(**data)[source]¶
Bases:
BaseModelPublic per-provider local configuration readiness verdict.
Wraps the pure-local
probe_provider_credentials()(no network, no active-profile requirement) so the workstation doctor (aeat config check) can render one certificate / Cl@ve Móvil readiness row percore.auth_provider.AuthProviderKinddirectly fromcore.config.Settings.resultis the typedProviderProbeResult;summaryis the localised one-line operator-facing verdict.- Parameters:
data (Any)
- provider: str¶
- result: ProviderProbeResult¶
- summary: str¶
- probe_provider_configuration(provider, *, settings=None, operator_probe_ports)[source]¶
Run the pure-local per-provider configuration probe for
provider.Resolves the certificate path or Cl@ve Móvil identity from
core.config.Settingsand classifies the local configuration health without any network call or active-profile session. Returns a typedProviderConfigurationProbe; it never raises for a missing or malformed configuration — an absent provider surfaces asProviderProbeResult.NO_PATH_SET/ProviderProbeResult.IDENTITY_UNSET, a broken one asexpired/corrupt/invalid_identity.- Return type:
- Parameters:
provider (str)
settings (Settings | None)
operator_probe_ports (OperatorProbePorts)
- probe_provider_credentials(provider, certificate_path, *, settings=None, certificate_credentials=None, operator_probe_ports)[source]¶
Probe one provider using the caller’s already-resolved credential snapshot.
- Return type:
- Parameters:
provider (str)
certificate_path (str)
settings (Settings | None)
certificate_credentials (ActiveCertificateCredentials | None)
operator_probe_ports (OperatorProbePorts)
- probe_certificate_bundle(certificate_path, *, settings=None, certificate_credentials=None, operator_probe_ports)[source]¶
Open the configured
.p12and classify the certificate’s health.Resolves the three certificate-state cases distinctly: no path, path-set-file-missing, path-set-file-present. The file-present case additionally opens the bundle and inspects expiry through
adapters.outbound.aeat.auth.certificate.health(), which reportsEXPIREDfor an already-lapsed certificate rather than raising — an expired but otherwise well-formed bundle must classify asexpired, nevercorrupt.- Return type:
_ProviderProbeOutcome- Parameters:
certificate_path (str)
settings (Settings | None)
certificate_credentials (ActiveCertificateCredentials | None)
operator_probe_ports (OperatorProbePorts)