Skip to main content

Module headers

Module headers 

Source
Expand description

Canonical header extraction for ASH protocol.

This module provides a single, authoritative function for extracting ASH-required headers from any HTTP framework. Middlewares should use ash_extract_headers() instead of reimplementing header parsing.

§Why This Exists

Previously, every middleware (Express, FastAPI, Laravel, Gin, etc.) reimplemented header extraction with subtle differences in:

  • Case-insensitive lookup
  • Multi-value handling
  • Whitespace trimming
  • Control character rejection

This caused systemic bugs (null nonce bypasses, enum mismatches). Moving extraction into Core eliminates this entire bug class.

Structs§

HeaderBundle
Extracted ASH headers, validated and trimmed.

Constants§

HDR_BODY_HASH
ASH body hash header name.
HDR_CONTEXT_ID
ASH context ID header name.
HDR_NONCE
ASH nonce header name.
HDR_PROOF
ASH proof header name.
HDR_TIMESTAMP
ASH timestamp header name.

Traits§

HeaderMapView
Framework-agnostic header map interface.

Functions§

ash_extract_headers
Extract and validate all required ASH headers from a request.