{
  "scheme": "DX1-HMAC-SHA256",
  "warning": "TEST-ONLY, NOT PRODUCTION. This key and secret are published, sign nothing real and must never be used or issued anywhere.",
  "key": {
    "key_id": "dxk_TestVectorKey001",
    "secret": "dxs_VEVTVC1PTkxZLU5PVC1BLVJFQUwtS0VZLTAxMjM0NTY",
    "signing_key_ascii": "TEST-ONLY-NOT-A-REAL-KEY-0123456"
  },
  "vectors": [
    {
      "name": "get-no-body",
      "description": "GET with no body and no query string.",
      "input": {
        "method": "GET",
        "url": "https://api.example.test/v1/lobbies",
        "timestamp": 1767225600,
        "nonce": "nonce-get-no-body-0001",
        "body": ""
      },
      "expected": {
        "canonical_path": "/v1/lobbies",
        "canonical_query": "",
        "body_utf8_hex": "",
        "body_sha256_hex": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_string": "DX1-HMAC-SHA256\nGET\n/v1/lobbies\n\n1767225600\nnonce-get-no-body-0001\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ndxk_TestVectorKey001",
        "signature": "Z7XK8gayjEeLc72ehYCXmoNUETmOso9DuQhwfbB00Pg",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225600",
          "X-DX-Nonce": "nonce-get-no-body-0001",
          "X-DX-Signature": "Z7XK8gayjEeLc72ehYCXmoNUETmOso9DuQhwfbB00Pg"
        }
      }
    },
    {
      "name": "post-json-body",
      "description": "POST with a JSON body (ASCII). The body hash covers the exact bytes sent.",
      "input": {
        "method": "POST",
        "url": "https://api.example.test/v1/auth/player-sessions",
        "timestamp": 1767225601,
        "nonce": "nonce-post-json-0002",
        "body": "{\"external_player_id\":\"u-1001\",\"username\":\"Alice\",\"scoring_method\":\"manual\"}"
      },
      "expected": {
        "canonical_path": "/v1/auth/player-sessions",
        "canonical_query": "",
        "body_utf8_hex": "7b2265787465726e616c5f706c617965725f6964223a22752d31303031222c22757365726e616d65223a22416c696365222c2273636f72696e675f6d6574686f64223a226d616e75616c227d",
        "body_sha256_hex": "4fc2598683ae67b8d35995b884d7ab3e9b2738522088fa3f830c95b619acdbdf",
        "canonical_string": "DX1-HMAC-SHA256\nPOST\n/v1/auth/player-sessions\n\n1767225601\nnonce-post-json-0002\n4fc2598683ae67b8d35995b884d7ab3e9b2738522088fa3f830c95b619acdbdf\ndxk_TestVectorKey001",
        "signature": "os8bsiZ0NF3DHBI2gx4AEgZ2VIqXkl2Y0V1S8DBTni4",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225601",
          "X-DX-Nonce": "nonce-post-json-0002",
          "X-DX-Signature": "os8bsiZ0NF3DHBI2gx4AEgZ2VIqXkl2Y0V1S8DBTni4"
        }
      }
    },
    {
      "name": "post-empty-body",
      "description": "POST with an empty body: the body hash is the SHA-256 of zero bytes.",
      "input": {
        "method": "POST",
        "url": "https://api.example.test/v1/lobbies/lb_AAAAAAAAAAAAAAAAAAAAAA/heartbeat",
        "timestamp": 1767225602,
        "nonce": "nonce-post-empty-0003",
        "body": ""
      },
      "expected": {
        "canonical_path": "/v1/lobbies/lb_AAAAAAAAAAAAAAAAAAAAAA/heartbeat",
        "canonical_query": "",
        "body_utf8_hex": "",
        "body_sha256_hex": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_string": "DX1-HMAC-SHA256\nPOST\n/v1/lobbies/lb_AAAAAAAAAAAAAAAAAAAAAA/heartbeat\n\n1767225602\nnonce-post-empty-0003\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ndxk_TestVectorKey001",
        "signature": "3mnZklX7YH9V7nJ1vtfu80-4M2a_9dX_62CUbtoEtEw",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225602",
          "X-DX-Nonce": "nonce-post-empty-0003",
          "X-DX-Signature": "3mnZklX7YH9V7nJ1vtfu80-4M2a_9dX_62CUbtoEtEw"
        }
      }
    },
    {
      "name": "query-sorting",
      "description": "Query pairs are sorted by name then value, including repeated names.",
      "input": {
        "method": "GET",
        "url": "https://api.example.test/v1/lobbies?z=1&b=2&a=2&a=1&limit=10",
        "timestamp": 1767225603,
        "nonce": "nonce-query-sort-0004",
        "body": ""
      },
      "expected": {
        "canonical_path": "/v1/lobbies",
        "canonical_query": "a=1&a=2&b=2&limit=10&z=1",
        "body_utf8_hex": "",
        "body_sha256_hex": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_string": "DX1-HMAC-SHA256\nGET\n/v1/lobbies\na=1&a=2&b=2&limit=10&z=1\n1767225603\nnonce-query-sort-0004\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ndxk_TestVectorKey001",
        "signature": "XgVMkgMzjrU8ZrbVd92cM5DJa6uK6BnHVnqXtF9lFM4",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225603",
          "X-DX-Nonce": "nonce-query-sort-0004",
          "X-DX-Signature": "XgVMkgMzjrU8ZrbVd92cM5DJa6uK6BnHVnqXtF9lFM4"
        }
      }
    },
    {
      "name": "query-encoding",
      "description": "Query decoding and RFC 3986 re-encoding: percent hex upper-cased, '+' is a space, empty values, valueless names, reserved characters, ~ stays literal.",
      "input": {
        "method": "GET",
        "url": "https://api.example.test/v1/lobbies?q=a%20b&p=a+b&e=&flag&s=%21%27%28%29%2a~&lower=%c3%a9",
        "timestamp": 1767225604,
        "nonce": "nonce-query-enc-0005",
        "body": ""
      },
      "expected": {
        "canonical_path": "/v1/lobbies",
        "canonical_query": "e=&flag=&lower=%C3%A9&p=a%20b&q=a%20b&s=%21%27%28%29%2A~",
        "body_utf8_hex": "",
        "body_sha256_hex": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_string": "DX1-HMAC-SHA256\nGET\n/v1/lobbies\ne=&flag=&lower=%C3%A9&p=a%20b&q=a%20b&s=%21%27%28%29%2A~\n1767225604\nnonce-query-enc-0005\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ndxk_TestVectorKey001",
        "signature": "yOfsZhkFUN-FxHhycw1X57xjBiMOncH4JKLtYOlZauE",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225604",
          "X-DX-Nonce": "nonce-query-enc-0005",
          "X-DX-Signature": "yOfsZhkFUN-FxHhycw1X57xjBiMOncH4JKLtYOlZauE"
        }
      }
    },
    {
      "name": "utf8-body",
      "description": "UTF-8 body sent as raw UTF-8 bytes (not \\u escapes): accents, CJK, emoji (4-byte).",
      "input": {
        "method": "POST",
        "url": "https://api.example.test/v1/auth/player-sessions",
        "timestamp": 1767225605,
        "nonce": "nonce-utf8-body-0006",
        "body": "{\"external_player_id\":\"u-2002\",\"username\":\"Zoë 日本 🎯\",\"scoring_method\":\"automatic\"}"
      },
      "expected": {
        "canonical_path": "/v1/auth/player-sessions",
        "canonical_query": "",
        "body_utf8_hex": "7b2265787465726e616c5f706c617965725f6964223a22752d32303032222c22757365726e616d65223a225a6fc3ab20e697a5e69cac20f09f8eaf222c2273636f72696e675f6d6574686f64223a226175746f6d61746963227d",
        "body_sha256_hex": "228f7a52e33687c2159a4a6563d504a86957cfc4f02c8fd39507224a49a15144",
        "canonical_string": "DX1-HMAC-SHA256\nPOST\n/v1/auth/player-sessions\n\n1767225605\nnonce-utf8-body-0006\n228f7a52e33687c2159a4a6563d504a86957cfc4f02c8fd39507224a49a15144\ndxk_TestVectorKey001",
        "signature": "qk4oado9hEFJItOJnh7ApKI2ZmEB8MVViEqhWpqi1nM",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225605",
          "X-DX-Nonce": "nonce-utf8-body-0006",
          "X-DX-Signature": "qk4oado9hEFJItOJnh7ApKI2ZmEB8MVViEqhWpqi1nM"
        }
      }
    },
    {
      "name": "utf8-query",
      "description": "UTF-8 in the query string: sent percent-encoded, signed in the canonical form.",
      "input": {
        "method": "GET",
        "url": "https://api.example.test/v1/lobbies?name=Zo%C3%AB%20%E6%97%A5%E6%9C%AC%20%F0%9F%8E%AF",
        "timestamp": 1767225606,
        "nonce": "nonce-utf8-query-0007",
        "body": ""
      },
      "expected": {
        "canonical_path": "/v1/lobbies",
        "canonical_query": "name=Zo%C3%AB%20%E6%97%A5%E6%9C%AC%20%F0%9F%8E%AF",
        "body_utf8_hex": "",
        "body_sha256_hex": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_string": "DX1-HMAC-SHA256\nGET\n/v1/lobbies\nname=Zo%C3%AB%20%E6%97%A5%E6%9C%AC%20%F0%9F%8E%AF\n1767225606\nnonce-utf8-query-0007\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ndxk_TestVectorKey001",
        "signature": "YzWRG35r6nUF9Ko2jw1YmUY9tT18b9rLuNEydPRQze8",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225606",
          "X-DX-Nonce": "nonce-utf8-query-0007",
          "X-DX-Signature": "YzWRG35r6nUF9Ko2jw1YmUY9tT18b9rLuNEydPRQze8"
        }
      }
    },
    {
      "name": "method-case",
      "description": "The method is upper-cased before signing, so 'post' signs the same as 'POST'.",
      "input": {
        "method": "post",
        "url": "https://api.example.test/v1/lobbies/lb_AAAAAAAAAAAAAAAAAAAAAA/cancel",
        "timestamp": 1767225607,
        "nonce": "nonce-method-case-0008",
        "body": ""
      },
      "expected": {
        "canonical_path": "/v1/lobbies/lb_AAAAAAAAAAAAAAAAAAAAAA/cancel",
        "canonical_query": "",
        "body_utf8_hex": "",
        "body_sha256_hex": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "canonical_string": "DX1-HMAC-SHA256\nPOST\n/v1/lobbies/lb_AAAAAAAAAAAAAAAAAAAAAA/cancel\n\n1767225607\nnonce-method-case-0008\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ndxk_TestVectorKey001",
        "signature": "brdKeF7DTIfICcuKF8alHImuG2cbktQAt1kB8H_Rbtw",
        "headers": {
          "X-DX-Key-Id": "dxk_TestVectorKey001",
          "X-DX-Timestamp": "1767225607",
          "X-DX-Nonce": "nonce-method-case-0008",
          "X-DX-Signature": "brdKeF7DTIfICcuKF8alHImuG2cbktQAt1kB8H_Rbtw"
        }
      }
    }
  ]
}
