Expand description
Data-reference fetching + hash verification (feature = “client”).
DataRef tells a consumer where a piece of underlying data
lives; this module fetches it and verifies its integrity against the
producer-signed content_hash (RFC-ACDP-0002 §6).
Three pieces:
DataRefFetcher— trait that abstracts the fetch strategy. Native async-fn-in-trait, soimpl DataRefFetcherworks directly in generic positions. Wrap a custom impl inBox<dyn …>only if your call site needs dynamic dispatch.HttpsDataRefFetcher— concrete fetcher forhttps://…URIs. The defaultacdp_safe_http::SsrfPolicyis HTTPS-only;http://is rejected at the URL boundary before any socket activity. A test SSRF policy withallow_http: truemay relax this. Caps response size at 16 MiB and has a 30 s timeout. Structured locators are NOT handled — they need protocol-specific knowledge.fetch_and_verify_data_ref— convenience helper that wires a fetcher to the declaredcontent_hash, returning bytes only after the SHA-256 matches.
§Embedded refs
fetch_and_verify_data_ref short-circuits embedded refs without
touching the fetcher — the bytes are already in the body. The
embedded-hash check (RFC-ACDP-0003 §2.1 step 3) is the
acdp_validation::verify_embedded_hash entry point.
Structs§
- Https
Data RefFetcher - Default HTTPS-only fetcher.
Constants§
- DEFAULT_
MAX_ BYTES - Default response-size cap for an HTTPS data-ref fetch.
Traits§
- Data
RefFetcher - Pluggable fetch strategy for a
DataRef. Implementations are responsible for SSRF defenses and response-size caps on URI fetches; structured locators are protocol-specific and likely need their own trait impl per scheme (kafka.offset,ipfs.cid, …).
Functions§
- fetch_
and_ verify_ data_ ref - Convenience: fetch a
DataRefand verify its declaredcontent_hash.