Enforce source-time provenance across ingest

This commit is contained in:
Codex
2026-06-08 00:35:50 +02:00
parent 61f3a217e6
commit ee8887b97f
4 changed files with 51 additions and 25 deletions

View File

@@ -31,6 +31,13 @@ func TestClientCallsProductionV2Endpoints(t *testing.T) {
if r.Header.Get("Idempotency-Key") == "" {
t.Fatalf("idempotency key missing")
}
var payload map[string]any
if err := json.NewDecoder(r.Body).Decode(&payload); err != nil {
t.Fatalf("decode event body: %v", err)
}
if payload["occurredAt"] == "" {
t.Fatalf("occurredAt missing from event body")
}
json.NewEncoder(w).Encode(EventReceipt{
StreamID: "str_123", StreamEventID: "evt_123", SeqNo: 1, EventHash: strings.Repeat("a", 64), StreamHeadHash: strings.Repeat("b", 64),
Receipt: SignedReceipt{Payload: M{}, ReceiptHash: strings.Repeat("c", 64), Signature: ReceiptSignature{Alg: "ed25519"}},