Skip to content

Commit 8ecab04

Browse files
committed
fix: use challenge name (not UUID) for JWT token generation
JWT tokens for broker authentication should use the human-readable challenge name (config.name) instead of the UUID (config.challenge_id). This ensures the JWT's challenge_id matches what the challenge container sends in its requests to the broker, preventing 'Challenge mismatch' errors. This aligns with CHALLENGE_ID environment variable which already uses the challenge name, ensuring consistency across all challenge communications.
1 parent 6da49e2 commit 8ecab04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/challenge-orchestrator/src/docker.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,9 @@ impl DockerClient {
656656

657657
// Generate a JWT token for this challenge
658658
// Token includes challenge_id and validator_hotkey for authorization
659-
let challenge_id = config.challenge_id.to_string();
659+
// Use config.name (human-readable challenge name) instead of config.challenge_id (UUID)
660+
// This ensures JWT matches the challenge_id sent by the challenge container
661+
let challenge_id = config.name.to_string();
660662
let owner_id = std::env::var("VALIDATOR_HOTKEY").unwrap_or_else(|_| "unknown".to_string());
661663

662664
// Use secure_container_runtime to generate token (3600s = 1 hour TTL)

0 commit comments

Comments
 (0)