fix(multiplayer): repair allocated compose verification

This commit is contained in:
Josh Creek
2026-09-04 16:38:10 +01:00
parent e6733bd6cb
commit d64920b0f9
11 changed files with 150 additions and 48 deletions
+14
View File
@@ -47,6 +47,20 @@ func TestResultStoreRejectsMissingAuthoritativeTime(t *testing.T) {
}
}
func TestResultStoreAcceptsDurablyBoundSignedWorkloadIdentity(t *testing.T) {
// Signed workload tokens resolve this three-part binding from the durable
// allocation record; they intentionally carry no Kubernetes JWT claims.
binding := WorkloadBinding{AllocationID: "allocation-1", MatchID: "match-1", ServerID: "server-1"}
if _, err := NewResultStore(binding); err != nil {
t.Fatalf("signed workload binding rejected: %v", err)
}
partial := binding
partial.Issuer = "https://issuer"
if _, err := NewResultStore(partial); !errors.Is(err, ErrResultBinding) {
t.Fatalf("partial Kubernetes identity error = %v, want ErrResultBinding", err)
}
}
func TestConflictingResultIsInertAndIntegritySuppressesRating(t *testing.T) {
now := time.Unix(1000, 0)
binding := testBinding()