"""Authenticated, read-only censo acquisition from AEAT.The returned observation is not adopted until the user-profile workflow reviewsand commits it through its separate canonical authority."""from__future__importannotationsfromtypingimportTYPE_CHECKINGfrom..auth.certificate_secret_backendimportCertificateSecretBackendFactoryfrom..auth.operator_scope_portsimportOperatorScopePortsfrom..auth.protocolsimportBrowserSessionFactoryPortfrom.censo_portsimportCensalFetchPortfrom.sessionimportactive_verified_sessionifTYPE_CHECKING:from..user_profile.censal_observationimportCensalObservationLIVE_CENSAL_READ_OPERATION="live-censal-read"
[docs]asyncdefpull_censal_datos(*,certificate_secret_backend_factory:CertificateSecretBackendFactory,browser_session_factory:BrowserSessionFactoryPort,operator_scope_ports:OperatorScopePorts,censal_fetch_port:CensalFetchPort,guarded_read_context:str|None=None,)->CensalObservation:"""Read the authenticated taxpayer's censo state without persisting or adopting it."""session,settings=awaitactive_verified_session(certificate_secret_backend_factory=certificate_secret_backend_factory,browser_session_factory=browser_session_factory,operation=LIVE_CENSAL_READ_OPERATION,operator_scope_ports=operator_scope_ports,guarded_read_context=guarded_read_context,)returnawaitcensal_fetch_port(session,taxpayer_nif=session.identity_nif,settings=settings)