fix: prevent concurrent join token reuse

This commit is contained in:
Josh Creek
2026-09-01 08:41:38 +01:00
parent 68d832f7bc
commit 4b01b7fc88
3 changed files with 19 additions and 1 deletions
+3
View File
@@ -54,3 +54,6 @@ func test_allocated_join_authorisation_is_allowlisted_and_bound_to_server() -> v
wrong_claims["ServerID"] = "other-server"
var wrong_token := Marshalls.raw_to_base64(JSON.stringify({"Authorisation": wrong_claims, "Signature": "trusted-signature"}).to_utf8_buffer())
assert_true(not match_net._valid_join_authorisation(wrong_token), "wrong server claim is rejected")
assert_true(not match_net.is_join_authorisation_active(token), "validated token is not active before admission")
match_net._active_join_peers[token] = 42
assert_true(match_net.is_join_authorisation_active(token), "active token is visible to the duplicate-admission guard")