aeat.adapters.outbound.aeat.auth package¶
Public outbound AEAT auth facade.
This package mirrors the application auth contract from
application.auth by re-exporting
application.auth.AuthProvider and
application.auth.AuthProviderKind alongside the concrete
certificate, Cl@ve Móvil, and Cl@ve Permanente providers. Use
select_provider() to resolve
CERTIFICATE to AeatAuthenticator
and CLAVE_MOVIL to
ClaveMovilAuthProvider, or CLAVE_PERMANENTE to
ClavePermanenteAuthProvider;
unsupported kinds raise
AuthConfigurationError.
Authentication results are strict, frozen, secret-free records:
AeatSession and
AeatLoginAssertion carry
provider-specific payloads through the discriminated AuthSessionDetail and
AuthLoginAssertionDetail unions.
Selected certificate public API is available through
adapters.outbound.aeat.auth.certificate, including
adapters.outbound.aeat.auth.certificate.load_certificate(),
adapters.outbound.aeat.auth.certificate.verify_handshake(), and
adapters.outbound.aeat.auth.certificate.health().
Live-read policy is owned by
core.access_gate.AeatAccessGate: pytest live reads require
the live-test opt-in enabled, while operator-context reads continue
through auth, profile, and read-only guards. The associated
core.access_gate.AeatGateEnvSnapshot records only the
live-test opt-in flag and the current pytest test id. Live AEAT writes and
live AEAT submissions are permanently refused by
core.access_gate.LiveSubmitForbiddenError; auth exposes no
AEAT-side write verb.
Errors remain typed at the facade boundary, including
AuthError,
AuthConfigurationError,
AeatLoginAssertionError,
AeatSessionExpiredError, certificate
errors, and Cl@ve Móvil errors.
- select_provider(kind, *, settings, browser_session_factory=None)[source]¶
Return the concrete outbound
AuthProviderforkind.AuthProviderKind.CERTIFICATEbuilds anAeatAuthenticator;AuthProviderKind.CLAVE_MOVILbuilds aClaveMovilAuthProvider;AuthProviderKind.CLAVE_PERMANENTEbuilds aClavePermanenteAuthProvider. The optional browser session factory is forwarded to browser-backed providers so application code can share Playwright sessions without depending on adapter internals.- Raises:
AuthConfigurationError – If
kindis outside the supportedAuthProviderKindset.- Return type:
- Parameters:
kind (AuthProviderKind)
settings (Settings)
browser_session_factory (BrowserSessionFactory | None)
Subpackages¶
- aeat.adapters.outbound.aeat.auth._certificate_backends package
Submodules¶
- aeat.adapters.outbound.aeat.auth._authenticator module
AEAT_SESSION_IDLE_TTLAEAT_LOGIN_NAVIGATION_TIMEOUT_MSAeatAuthenticatorAeatAuthenticator.kindAeatAuthenticator.load_certificate()AeatAuthenticator.health()AeatAuthenticator.verify_handshake()AeatAuthenticator.authenticate()AeatAuthenticator.reauthenticate()AeatAuthenticator.verify_login()AeatAuthenticator.verify()AeatAuthenticator.capture_storage_state()AeatAuthenticator.resume_from_storage_state()AeatAuthenticator.describe()AeatAuthenticator.close()
- aeat.adapters.outbound.aeat.auth._authenticator_persistence module
AEAT_STORAGE_STATE_SCHEMA_VERSIONPersistedSessionMetadataPersistedSessionMetadata.schema_versionPersistedSessionMetadata.certificate_thumbprintPersistedSessionMetadata.certificate_subjectPersistedSessionMetadata.certificate_nifPersistedSessionMetadata.authenticated_atPersistedSessionMetadata.idle_deadlinePersistedSessionMetadata.storage_state_sha256PersistedSessionMetadata.handshake
persisted_session_reason_code()persisted_session_reason_from_error()
- aeat.adapters.outbound.aeat.auth._authenticator_types module
AeatLoginAssertionAeatLoginAssertion.target_urlAeatLoginAssertion.is_validAeatLoginAssertion.provider_kindAeatLoginAssertion.identity_nifAeatLoginAssertion.status_codeAeatLoginAssertion.elapsed_msAeatLoginAssertion.attempted_atAeatLoginAssertion.error_messageAeatLoginAssertion.assertion_detailAeatLoginAssertion.handshake_successAeatLoginAssertion.certificate_recognisedAeatLoginAssertion.parsed_nifAeatLoginAssertion.parsed_subject
AeatSessionBrowserPageLikeBrowserResponseLikeBrowserContextLikeBrowserSessionProfileLikeBrowserSessionLikeCertificateHealthCheckBrowserSessionFactory
- aeat.adapters.outbound.aeat.auth._clave_movil module
- aeat.adapters.outbound.aeat.auth._clave_movil_metadata module
AEAT_CLAVE_MOVIL_METADATA_SCHEMA_VERSIONClaveMovilSessionMetadataClaveMovilSessionMetadata.schema_versionClaveMovilSessionMetadata.provider_kindClaveMovilSessionMetadata.identity_nifClaveMovilSessionMetadata.authenticated_atClaveMovilSessionMetadata.idle_deadlineClaveMovilSessionMetadata.storage_state_sha256ClaveMovilSessionMetadata.used_non_qr_fallbackClaveMovilSessionMetadata.verification_codeClaveMovilSessionMetadata.landing_url
- aeat.adapters.outbound.aeat.auth._clave_movil_page_flow module
- aeat.adapters.outbound.aeat.auth._clave_movil_support module
- aeat.adapters.outbound.aeat.auth._clave_permanente module
- aeat.adapters.outbound.aeat.auth._clave_permanente_metadata module
AEAT_CLAVE_PERMANENTE_METADATA_SCHEMA_VERSIONClavePermanenteSessionMetadataClavePermanenteSessionMetadata.schema_versionClavePermanenteSessionMetadata.provider_kindClavePermanenteSessionMetadata.identity_nifClavePermanenteSessionMetadata.authenticated_atClavePermanenteSessionMetadata.idle_deadlineClavePermanenteSessionMetadata.storage_state_sha256ClavePermanenteSessionMetadata.landing_url
- aeat.adapters.outbound.aeat.auth._clave_permanente_support module
- aeat.adapters.outbound.aeat.auth._errors module
- aeat.adapters.outbound.aeat.auth._fixtures module
- aeat.adapters.outbound.aeat.auth._providers module
- aeat.adapters.outbound.aeat.auth._session_store module
- aeat.adapters.outbound.aeat.auth.certificate module
CertificateErrorCertificateLoadErrorCertificatePasswordErrorCertificateExpiredErrorCertificatePreExpiryErrorCertificateHandshakeErrorCertificateNifParseErrorCertificateHealthSeverityCertificateBundleLoadedCertificateCertificateHealthCertificateHealth.subjectCertificateHealth.issuerCertificateHealth.serial_numberCertificateHealth.not_beforeCertificateHealth.not_afterCertificateHealth.days_until_expiryCertificateHealth.severityCertificateHealth.warn_threshold_daysCertificateHealth.critical_threshold_daysCertificateHealth.evaluated_at
HandshakeResultload_certificate()evaluate_loaded_certificate_health()health()extract_nif_from_subject()preload_into_browser_context()verify_handshake()