Skip to main content

Crate kamu_snap_crypto_actix

Crate kamu_snap_crypto_actix 

Source
Expand description

actix-web inbound-verify glue for SNAP BI service signatures.

Provides verify_request — a single function that takes the parts of an actix-web request (method, path, headers, body) plus a client secret, and returns Ok(()) iff the incoming X-SIGNATURE validates against the canonical SNAP BI service stringToSign.

A full Transform/middleware wrapper is intentionally deferred to a v2.x release — body extraction inside actix middleware requires buffer-and-replay plumbing that’s better designed once we have a production caller. For now, consumers call verify_request from inside their own handler (or a custom FromRequest extractor) after the body is materialised.

Functions§

verify_request
Verify a SNAP BI service request against client_secret. Returns Ok(()) when X-SIGNATURE matches the canonical stringToSign computed from the supplied method, path, body, X-TIMESTAMP header, and Bearer access token. Any missing header or signature mismatch yields a kamu_snap_crypto::Error.