move common test data to contracts/

This commit is contained in:
2026-11-10 09:53:47 +03:00
parent 219448ccfb
commit 1bc688055a
3 changed files with 74 additions and 15 deletions
+13
View File
@@ -0,0 +1,13 @@
{
"description": "Shared test vectors for the HMAC authentication of the internal game-server -> main-server endpoints. Both test suites (main-server/spec/services/internal_signature_service_spec.rb and game-server/internal/mainserver/reporter_test.go) read this file, so it is the single source of truth for the wire format. Signature algorithm: hex(HMAC-SHA256(secret, \"<timestamp>.<path>.<body>\")), where path is the request path without the query string.",
"vectors": [
{
"name": "player1_won report",
"secret": "test-secret-key-base",
"timestamp": 1700000000,
"path": "/api/internal/matches/abc/result",
"body": "{\"status\":\"player1_won\",\"duration_seconds\":42}",
"signature_hex": "e0a7f8b5508639b1afe604b41f00070dd282d02b6444db5b4856959f175e8361"
}
]
}