Skip to content
Playground(another site)

bynk.actor.signature_requires_body

Error A Signature handler does not take a body parameter.

A Signature is an HMAC over the raw request body, so the handler must take that body: one with no body parameter would vouch for data it never reads. Add (body: T), where T is the payload's type. A route that takes no payload has nothing for a signature to protect.

Example

actor Hook { auth = Signature(secret = "WEBHOOK_KEY", header = "X-Sig") }
service api from http {
on POST("/x") () -> Effect[HttpResult[String]] by Hook { // ✗ no `body` parameter
on POST("/x") (body: String) -> Effect[HttpResult[String]] by Hook { // ✓ the signed payload

In the Book

See also

  • Every code in its category, Actors, on the diagnostic index.
  • bynk explain bynk.actor.signature_requires_body shows the same from the installed toolchain, without a network.