mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix: prevent concurrent join token reuse
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user