Skip to main content

Module layer

Module layer 

Source
Expand description

A Tower Layer that advertises a C2PA Manifest Store on every response.

The header is appended, never set: a response may already carry Link fields for preload, canonical, or pagination hints, and replacing them would break unrelated behaviour.

§Scope

This attaches and reads a header. It deliberately does not inspect request or response bodies to detect embedded provenance: doing so means buffering the entire body before it can be forwarded, which turns a streaming proxy into an unbounded memory sink and hands any client a denial of service. A body-inspecting middleware needs a mandatory size cap and a considered failure mode, and belongs behind its own explicit opt-in rather than in the layer that writes a header.

Structs§

ManifestLinkLayer
A Layer that appends a c2pa-manifest link to every response.
ManifestLinkService
The Service produced by ManifestLinkLayer.
ResponseFuture
Appends the header once the inner service resolves.

Constants§

LINK
The Link header name.

Functions§

append_to
Append a c2pa-manifest link to a header map.
extract_from
The c2pa-manifest link advertised by a header map, if exactly one is.