feat: Harden Realtime Event Authorization with JWT and Centralized Guard#173
Merged
anonfedora merged 2 commits intoArenax-gaming:mainfrom Mar 30, 2026
Merged
feat: Harden Realtime Event Authorization with JWT and Centralized Guard#173anonfedora merged 2 commits intoArenax-gaming:mainfrom
anonfedora merged 2 commits intoArenax-gaming:mainfrom
Conversation
…event infrastructure
|
Someone is attempting to deploy a commit to the paul joseph's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@bytebinders Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
|
Hi @anonfedora, I noticed the Vercel check is currently failing due to deployment authorization. The changes themselves should be independent of deployment, but please let me know if any adjustments are needed from my side. Happy to make updates if required. Thanks! |
anonfedora
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was done:
RealtimeAuthguard inbackend/src/realtime/auth.rsto authorize channel subscriptions.ws_handlerinbackend/src/realtime/user_ws.rsto require and validate a JWT access token before upgrading the connection.Subscribe,Unsubscribe, andPublishvariants toClientMessageinbackend/src/realtime/events.rs.SessionRegistryto track explicit channel subscriptions for authorized event routing.WsBroadcasterto route match events only to authorized subscribers.JwtServiceandRealtimeAuthinto the main application infrastructure inmain.rs.Why it was done:
To prevent unauthorized users from subscribing to private event streams (user-scoped or match-scoped) and to enforce strict token-based identity verification for all real-time connections. This hardens the security of the
ArenaXgaming platform's real-time communication layer.How it was verified:
backend/tests/realtime_auth_test.rsto verify authorization logic for user and match channels.backend/tests/realtime_auth_integration_test.rsto verify that the WebSocket upgrade requires a valid JWT.Closes #163