cadrumo.adapters.outbound.aeat.sede.declarations_remote module

Remote-read guard and CSV-extraction helpers for the declarations fetch adapter.

The read guards (assert_read_http, assert_read_browser_action) are consumed only by _declarations_fetch.py, which delegates to them for its own _assert_read_http / _assert_read_browser_action wrappers. _walker.py — a separate declarations-register surface — declares its own non-delegating read guards and never imports from this module. extract_csv_from_url is shared more widely, by _declarations.py and _parse.py as well. External consumers import it from this defining module.

assert_read_http(method, url, *, policy)[source]

Refuse an HTTP call the read-only remote-state policy does not permit.

Return type:

None

Parameters:
assert_read_browser_action(action, *, policy)[source]

Refuse a browser action the read-only remote-state policy does not permit.

Return type:

None

Parameters:
extract_csv_from_url(url)[source]

Extract and shape-validate the CSV query parameter from a cotejo URL.

The return names AeatCsv to document an invariant this function already enforces rather than to add one: the is_aeat_csv() guard below is the same 8-32 uppercase alphanumeric shape the alias constrains toward, so every value returned here is already in the alias’s canonical form. A plain function’s annotation runs no validator; the guard is what refuses, and the alias is what names the contract the guard implements.

Return type:

str

Parameters:

url (str)