mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): reset expiry on reauthentication
This commit is contained in:
@@ -53,6 +53,13 @@ func test_session_expiry_is_checked_at_the_boundary_and_fails_closed() -> void:
|
||||
assert_true(not ControlPlaneClient.is_valid_rfc3339_timestamp("2026-08-31T12:00:00"), "timezone-less timestamp is rejected")
|
||||
|
||||
|
||||
func test_reconfiguration_discards_the_previous_session_expiry() -> void:
|
||||
var client := ControlPlaneClient.new()
|
||||
client.session_expires_at = "1970-01-01T00:00:01Z"
|
||||
assert_true(client.configure("https://match.example", "new-session:opaque-token"), "new session configures successfully")
|
||||
assert_eq(client.session_expires_at, "", "new credentials do not inherit the old expiry")
|
||||
|
||||
|
||||
func test_websocket_event_validation_requires_contract_specific_fields() -> void:
|
||||
var envelope := {"event": "state_changed", "revision": 1, "resource_id": "ticket_123456789", "occurred_at": "2026-08-31T12:00:00Z", "state": "QUEUED"}
|
||||
assert_true(ControlPlaneClient._valid_websocket_event(envelope), "valid state event is accepted")
|
||||
|
||||
Reference in New Issue
Block a user