Module graph_attestation

Module graph_attestation 

Source
Available on crate feature attestation only.
Expand description

An HTTP typed header for the graph-attestation header.

The graph-attestation header can contain a JSON-encoded Attestation struct, or an empty string if no attestation is provided.

§Using the headers::HeaderMapExt extension trait

use headers::HeaderMapExt as _;
use thegraph_headers::graph_attestation::{GraphAttestation, HEADER_NAME};

let mut header_map = http::HeaderMap::new();

// Insert a `graph-attestation` HTTP header
header_map.typed_insert(GraphAttestation(value));

// Get the `graph-attestation` HTTP header by name
let header_by_name = header_map.get(HEADER_NAME);
assert!(header_by_name.is_some());

// Get the `graph-attestation` HTTP header by type
let header_typed = header_map.typed_get::<GraphAttestation>();
assert!(matches!(header_typed, Some(GraphAttestation(..))));

Structs§

Attestation
An attestation of a request-response pair.
GraphAttestation
An HTTP typed header for the graph-attestation header.

Constants§

HEADER_NAME
The HTTP header name for the graph-attestation header.