Skip to main content

sign_headers

Function sign_headers 

Source
pub fn sign_headers(
    secrets: &[&WebhookSecret],
    id: &str,
    timestamp: i64,
    body: &[u8],
) -> SignedHeaders
Expand description

Build Standard Webhooks signed content and sign it with every secret in secrets.

The signed content is <id>.<timestamp>.<body> (concatenated bytes), per the Standard Webhooks specification. Each secret produces one v1,<base64> entry; multiple entries are joined with a space, which supports key rotation on both sender and receiver sides.

ยงPanics

Panics if secrets is empty. WebhookSender::send validates this before calling.