jws
constjws: (config?) =>Policy
Defined in: src/policies/auth/jws.ts:63
Verify JWS compact serialization signatures on requests.
The none algorithm is always rejected to prevent signature bypass attacks.
Config validation (secret or jwksUrl required) is performed at construction
time — a missing config throws immediately, not on first request.
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”Example
Section titled “Example”import { jws } from "@homegrower-club/stoma";
// HMAC verification with embedded payloadjws({ secret: env.JWS_SECRET });
// Detached JWS — payload comes from the request bodyjws({ secret: env.JWS_SECRET, payloadSource: "body" });