{
  "vectors": [
    {
      "id": "envelope-assessment-completed",
      "description": "A complete, schema-valid WebhookEventEnvelopeV1 for assessment.completed - the shape a real delivery carries. `occurredAt` sits 8s before `t`, because the event happens and is then delivered.",
      "rawBody": "{\"id\":\"018f3a5c-7b21-8c4d-9e6f-0a1b2c3d4e5f\",\"type\":\"assessment.completed\",\"version\":1,\"occurredAt\":\"2025-09-15T09:53:12.000Z\",\"tenantId\":\"4f9c1e2a-6d3b-4a15-9c8e-2b7d0f5a1c34\",\"sequence\":4,\"data\":{\"assignmentId\":\"7c2e9a10-5f4b-4d83-b1a6-9e0c3d7f2b58\",\"subjectId\":\"2a6f8c31-0b95-4e27-8d14-6c3a9f5b7e02\",\"relationshipType\":\"employee\",\"origin\":\"recruitment\",\"resultId\":\"9d1b4e76-3c82-4f09-a5d7-1e8b6c40f293\"}}",
      "timestamp": 1757930000,
      "secret": "CVjxZry3CPr1awYKmRay7qHMl_2Jo2Pa4I0DV1L4V9g",
      "expectedV1": "9b4d2f82c89f39c7a2780f4363b9cd3f97d6e9fca8696a73ef4555e6af499a51",
      "expectedHeader": "t=1757930000,v1=9b4d2f82c89f39c7a2780f4363b9cd3f97d6e9fca8696a73ef4555e6af499a51"
    },
    {
      "id": "empty-body",
      "description": "An empty body still signs `<t>.` and nothing more, so the separator can never be treated as optional.",
      "rawBody": "",
      "timestamp": 1757930001,
      "secret": "iJFGtcpX3zGOJHAhk0UIyGfvwb5YF2N4DMi2rRv8JjI",
      "expectedV1": "defcec1f0a73bb8827fe17056d35669085b561077244cbe7bde2d5ffde2b998d",
      "expectedHeader": "t=1757930001,v1=defcec1f0a73bb8827fe17056d35669085b561077244cbe7bde2d5ffde2b998d"
    },
    {
      "id": "multibyte-utf8",
      "description": "A literal U+00E9 occupies TWO bytes; a verifier that counts characters, or re-encodes as Latin-1, fails here.",
      "rawBody": "{\"note\":\"café\"}",
      "timestamp": 1757930002,
      "secret": "zDfMZbEdWnpGy7E2aNpHsUrVpabuxt0_cBp0thhH8PI",
      "expectedV1": "b2f42ef92c2f9342d801c84306c4365bd8d5c98d878a7c2bd7f3f53cc46c90d8",
      "expectedHeader": "t=1757930002,v1=b2f42ef92c2f9342d801c84306c4365bd8d5c98d878a7c2bd7f3f53cc46c90d8"
    },
    {
      "id": "unicode-escape",
      "description": "Same timestamp and secret as `multibyte-utf8`, and the same value after JSON.parse - a different signature. Any re-serialisation collapses the pair.",
      "rawBody": "{\"note\":\"caf\\u00e9\"}",
      "timestamp": 1757930002,
      "secret": "zDfMZbEdWnpGy7E2aNpHsUrVpabuxt0_cBp0thhH8PI",
      "expectedV1": "bb23195a7d7bf4870818154ad7edf18da4135ee5364a129c17fef32ec9497fc4",
      "expectedHeader": "t=1757930002,v1=bb23195a7d7bf4870818154ad7edf18da4135ee5364a129c17fef32ec9497fc4"
    },
    {
      "id": "separator-in-body",
      "description": "The body contains the separator and a digit run that looks like a timestamp. The signed string is still `<t>` + one `.` + the WHOLE body.",
      "rawBody": "{\"note\":\"1757930000.not-a-timestamp\"}",
      "timestamp": 1757930004,
      "secret": "2YqeFjOhv1O-cbBuKdsUMRYSJ6saZec7um_SJfCbsIQ",
      "expectedV1": "8038ce209a8bb0b22f80568564b7beb0e6e0e7b92fdacb95fbdc4cff8beaec8b",
      "expectedHeader": "t=1757930004,v1=8038ce209a8bb0b22f80568564b7beb0e6e0e7b92fdacb95fbdc4cff8beaec8b"
    },
    {
      "id": "key-order-variant",
      "description": "Same timestamp, secret and JSON value as `envelope-assessment-completed`, keys reordered - a different signature.",
      "rawBody": "{\"type\":\"assessment.completed\",\"id\":\"018f3a5c-7b21-8c4d-9e6f-0a1b2c3d4e5f\",\"version\":1,\"occurredAt\":\"2025-09-15T09:53:12.000Z\",\"tenantId\":\"4f9c1e2a-6d3b-4a15-9c8e-2b7d0f5a1c34\",\"sequence\":4,\"data\":{\"subjectId\":\"2a6f8c31-0b95-4e27-8d14-6c3a9f5b7e02\",\"assignmentId\":\"7c2e9a10-5f4b-4d83-b1a6-9e0c3d7f2b58\",\"relationshipType\":\"employee\",\"origin\":\"recruitment\",\"resultId\":\"9d1b4e76-3c82-4f09-a5d7-1e8b6c40f293\"}}",
      "timestamp": 1757930000,
      "secret": "CVjxZry3CPr1awYKmRay7qHMl_2Jo2Pa4I0DV1L4V9g",
      "expectedV1": "06c22910f93808977137fb413c903324bb2f15112ad88bbe282150869f5b4bd4",
      "expectedHeader": "t=1757930000,v1=06c22910f93808977137fb413c903324bb2f15112ad88bbe282150869f5b4bd4"
    }
  ],
  "rotation": [
    {
      "id": "rotation-overlap",
      "description": "The same body and timestamp as `envelope-assessment-completed`, signed mid-rotation. Version 1's value IS that vector's published digest, re-derived here by the other tool - so the overlap partner's value is corroborated twice, by openssl and by python3.",
      "rawBody": "{\"id\":\"018f3a5c-7b21-8c4d-9e6f-0a1b2c3d4e5f\",\"type\":\"assessment.completed\",\"version\":1,\"occurredAt\":\"2025-09-15T09:53:12.000Z\",\"tenantId\":\"4f9c1e2a-6d3b-4a15-9c8e-2b7d0f5a1c34\",\"sequence\":4,\"data\":{\"assignmentId\":\"7c2e9a10-5f4b-4d83-b1a6-9e0c3d7f2b58\",\"subjectId\":\"2a6f8c31-0b95-4e27-8d14-6c3a9f5b7e02\",\"relationshipType\":\"employee\",\"origin\":\"recruitment\",\"resultId\":\"9d1b4e76-3c82-4f09-a5d7-1e8b6c40f293\"}}",
      "timestamp": 1757930000,
      "activeSecretVersion": 2,
      "secrets": [
        {
          "version": 2,
          "secret": "M-g1X0N3SStx-4g9pNt46Cxl02ZQkbyUid7M3RyAt_8"
        },
        {
          "version": 1,
          "secret": "CVjxZry3CPr1awYKmRay7qHMl_2Jo2Pa4I0DV1L4V9g"
        }
      ],
      "expectedSignatures": [
        "841259adaec32f2e70de8a51d31a003df1ffe038166d3de41a6073aadb3021cd",
        "9b4d2f82c89f39c7a2780f4363b9cd3f97d6e9fca8696a73ef4555e6af499a51"
      ],
      "expectedHeader": "t=1757930000,v1=841259adaec32f2e70de8a51d31a003df1ffe038166d3de41a6073aadb3021cd,v1=9b4d2f82c89f39c7a2780f4363b9cd3f97d6e9fca8696a73ef4555e6af499a51"
    }
  ],
  "negative": [
    {
      "id": "tampered-body",
      "description": "`envelope-assessment-completed` with `\"sequence\":4` altered to `\"sequence\":5`, delivered under that vector's unaltered header.",
      "rejectionReason": "The signature is valid for the body Thomas sent, not for the body that arrived. Acceptance indicates a missing or incorrect signature comparison or a failure to hash the received body. JSON re-serialisation still preserves the altered sequence value.",
      "rawBody": "{\"id\":\"018f3a5c-7b21-8c4d-9e6f-0a1b2c3d4e5f\",\"type\":\"assessment.completed\",\"version\":1,\"occurredAt\":\"2025-09-15T09:53:12.000Z\",\"tenantId\":\"4f9c1e2a-6d3b-4a15-9c8e-2b7d0f5a1c34\",\"sequence\":5,\"data\":{\"assignmentId\":\"7c2e9a10-5f4b-4d83-b1a6-9e0c3d7f2b58\",\"subjectId\":\"2a6f8c31-0b95-4e27-8d14-6c3a9f5b7e02\",\"relationshipType\":\"employee\",\"origin\":\"recruitment\",\"resultId\":\"9d1b4e76-3c82-4f09-a5d7-1e8b6c40f293\"}}",
      "timestamp": 1757930000,
      "secret": "CVjxZry3CPr1awYKmRay7qHMl_2Jo2Pa4I0DV1L4V9g",
      "header": "t=1757930000,v1=9b4d2f82c89f39c7a2780f4363b9cd3f97d6e9fca8696a73ef4555e6af499a51",
      "honestV1": "9ead717843f51731dca42e0c91d77ea9135024f4d6e49fc58737574a6781a12c"
    }
  ]
}
