{
  "schema": "prepared-board.webhook-signature-vectors.v1",
  "scheme": "prepared-board.webhook-signature.v1",
  "header": "Prepared-Signature",
  "toleranceSeconds": 300,
  "signature": "v1 = lowercase hex HMAC-SHA256(key = UTF-8 bytes of the whole secret string including \"whsec_\", message = UTF-8 bytes of \"<t>.\" followed by the raw request body bytes)",
  "checkOrder": [
    "malformed_header: not comma-separated key=value items, no t or more than one, t not 1-15 decimal digits, a v1 that is not 64 lowercase hex characters, or longer than 4096 characters",
    "no_signatures: no v1 item",
    "timestamp_outside_tolerance: |now - t| > toleranceSeconds",
    "signature_mismatch: no v1 equals the expected signature for any of the receiver's secrets (compare in constant time)"
  ],
  "note": "These secrets are public test values. Never use them for a real endpoint.",
  "cases": [
    {
      "name": "basic",
      "description": "One secret, received 10 seconds after signing.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368010,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "unicode_body",
      "description": "The HMAC covers the UTF-8 bytes of the body exactly as received.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"id\":\"7\",\"note\":\"Café — résumé ✓ 東京 🎉\",\"type\":\"proposal.created\"}",
      "header": "t=1792368000,v1=ff97436dcba4bbdd19535d144c8fd86603b95076a4560ef6effcd2095bdebd72",
      "now": 1792368000,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "rotation_receiver_has_old_secret",
      "description": "During a rotation the header carries one v1 per live secret (new first). A receiver that still has only the old secret accepts.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=2be056013ac3e17dda0399cc528bbc07e6060bbc7a812fd4b25454bf52b3f177,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368001,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "rotation_receiver_has_new_secret",
      "description": "Same delivery; a receiver that already switched to the new secret accepts.",
      "secrets": [
        "whsec_z3kgYLajrCT0YF38cYAAxPfty8xdA0jmCsJ0_6FuZ04"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=2be056013ac3e17dda0399cc528bbc07e6060bbc7a812fd4b25454bf52b3f177,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368001,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "receiver_holds_two_secrets",
      "description": "A receiver may hold several secrets and accept a match on any.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4",
        "whsec_z3kgYLajrCT0YF38cYAAxPfty8xdA0jmCsJ0_6FuZ04"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=2be056013ac3e17dda0399cc528bbc07e6060bbc7a812fd4b25454bf52b3f177",
      "now": 1792368000,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "unknown_scheme_ignored",
      "description": "Keys other than t and v1 are ignored, so a future v2 can be added without breaking v1 receivers.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v2=not-yet-defined,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "spaces_around_items",
      "description": "Spaces and tabs around keys and values are ignored.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000, v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "tolerance_edge",
      "description": "Exactly 300 seconds old is still accepted.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368300,
      "expected": {
        "valid": true,
        "timestamp": 1792368000
      }
    },
    {
      "name": "tampered_body",
      "description": "One character of the body changed after signing.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":8,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "signature_mismatch"
      }
    },
    {
      "name": "reserialized_body",
      "description": "The receiver parsed and re-serialized the JSON before checking. Always verify the raw bytes.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\n  \"apiVersion\": \"1.6.0\",\n  \"boardId\": \"board_example\",\n  \"createdAt\": \"2026-10-19T00:00:00.000Z\",\n  \"data\": {\n    \"contentHash\": \"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\n    \"decisionId\": \"decision_example\",\n    \"sealId\": \"seal_example\",\n    \"seq\": 7,\n    \"version\": 1\n  },\n  \"id\": \"1042\",\n  \"subject\": {\n    \"id\": \"decision_example\",\n    \"type\": \"Decision\"\n  },\n  \"type\": \"decision.sealed\"\n}",
      "header": "t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "signature_mismatch"
      }
    },
    {
      "name": "wrong_secret",
      "description": "Signed with a different secret.",
      "secrets": [
        "whsec_z3kgYLajrCT0YF38cYAAxPfty8xdA0jmCsJ0_6FuZ04"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "signature_mismatch"
      }
    },
    {
      "name": "timestamp_changed",
      "description": "The t value was changed; it is part of the signed message.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368001,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "signature_mismatch"
      }
    },
    {
      "name": "too_old",
      "description": "301 seconds old: refused even though the signature is right (replay protection).",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368301,
      "expected": {
        "valid": false,
        "error": "timestamp_outside_tolerance"
      }
    },
    {
      "name": "too_far_in_future",
      "description": "Signed 301 seconds in the future.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792367699,
      "expected": {
        "valid": false,
        "error": "timestamp_outside_tolerance"
      }
    },
    {
      "name": "no_v1",
      "description": "A t but no v1 signature (only an unknown scheme).",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v0=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "no_signatures"
      }
    },
    {
      "name": "missing_timestamp",
      "description": "No t.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "malformed_header"
      }
    },
    {
      "name": "duplicate_timestamp",
      "description": "t appears twice.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,t=1792368000,v1=4243f6b64dd2cfe3b41017c0aa7b496ab992145fa0ba8d280e095fcf2398883a",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "malformed_header"
      }
    },
    {
      "name": "uppercase_hex",
      "description": "v1 must be 64 lowercase hex characters.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1=4243F6B64DD2CFE3B41017C0AA7B496AB992145FA0BA8D280E095FCF2398883A",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "malformed_header"
      }
    },
    {
      "name": "item_without_equals",
      "description": "Every item must be key=value.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "t=1792368000,v1",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "malformed_header"
      }
    },
    {
      "name": "empty_header",
      "description": "Header missing or empty.",
      "secrets": [
        "whsec_LHvdVL-TpbooLbHvNjn6jvLbSt_680J29oQ3cohToY4"
      ],
      "payload": "{\"apiVersion\":\"1.6.0\",\"boardId\":\"board_example\",\"createdAt\":\"2026-10-19T00:00:00.000Z\",\"data\":{\"contentHash\":\"sha256:02ef3e911871d5bab06ad996c97d4402cc8280024326d81b9353eaac88a969ac\",\"decisionId\":\"decision_example\",\"sealId\":\"seal_example\",\"seq\":7,\"version\":1},\"id\":\"1042\",\"subject\":{\"id\":\"decision_example\",\"type\":\"Decision\"},\"type\":\"decision.sealed\"}",
      "header": "",
      "now": 1792368000,
      "expected": {
        "valid": false,
        "error": "malformed_header"
      }
    }
  ]
}
