# `Ankusa.Sink.Http.Signer`
[🔗](https://github.com/jamescarr/ankusa/blob/ankusa-v0.7.0/packages/ankusa/lib/ankusa/sink/http/signer.ex#L1)

[Standard Webhooks](https://www.standardwebhooks.com/) signatures for
`Ankusa.Sink.Http`'s `:secret` option, so a worker can tell a delivery from
this node apart from anything else that can reach its URL.

Three headers: `webhook-id` (the hook id), `webhook-timestamp` (unix
seconds at send time) and `webhook-signature`, a space-separated list with
one `v1,<base64>` entry per secret — HMAC-SHA256 over
`"<webhook-id>.<webhook-timestamp>.<body>"`. Several secrets sign with each,
so a receiver can rotate keys without a gap.

A secret is `whsec_` + the base64 key (the Standard Webhooks form, decoded
with `Ankusa.Verifier.Hmac.raw_key/2`), or any other non-empty string, used
as its own bytes — the same rule every SDK's `verify_signature` applies
(`conformance/cases/signature.json`).

# `headers`

```elixir
@spec headers(String.t(), iodata(), String.t() | [String.t()], integer()) ::
  {:ok, [{String.t(), String.t()}]} | :error
```

The signature headers for one delivery, or `:error` when a secret is empty
or its `whsec_` base64 does not decode.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
