mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): bound workload credential lifetime
This commit is contained in:
@@ -114,6 +114,12 @@ func TestAllocateRequestsAWorkloadTokenAnnotationWhenConfigured(t *testing.T) {
|
||||
if claims.AllocationID != "allocation-1" {
|
||||
t.Fatalf("token names allocation %q, want %q", claims.AllocationID, "allocation-1")
|
||||
}
|
||||
if _, err := workload.ParseSignedWorkloadToken(secret, token, now.Add(DefaultWorkloadTokenTTL-time.Second)); err != nil {
|
||||
t.Fatalf("default token expired before its documented lifetime: %v", err)
|
||||
}
|
||||
if _, err := workload.ParseSignedWorkloadToken(secret, token, now.Add(DefaultWorkloadTokenTTL)); err == nil {
|
||||
t.Fatal("default token remained valid at its exact expiry boundary")
|
||||
}
|
||||
|
||||
gotAnnotations = nil
|
||||
unsigned := Client{BaseURL: server.URL, Namespace: "games", HTTP: server.Client()}
|
||||
|
||||
Reference in New Issue
Block a user