Skip to content

Conversation

@vshcherb
Copy link
Member

No description provided.

@alisa911
Copy link
Contributor

Copy link
Contributor

@RZR-UA RZR-UA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@alisa911
Copy link
Contributor

Security Techniques Added

Password-Protected Room Access via JWT Tokens:

  • JWT Bearer tokens for password-authenticated room access
  • Token-to-room binding validation (token must match specific translationId)
  • Time-limited tokens (30 minutes validity)
  • Token type verification (ROOM token type)

Rate Limiting:

  • Failed attempt tracking per WebSocket session
  • Maximum 5 failed attempts per session
  • 1-minute rate limit window
  • Automatic reset on successful access

Device-Based Access Control:

  • Device ID validation via X-Device-Id header
  • Per-device sharing restrictions (max 5 devices per user per translation)
  • Device-specific access matching for active sharers
  • Flexible matching: deviceId = 0 allows any device, specific deviceId restricts to that device only

Verified Users Cache:

  • In-memory cache of verified users per translation
  • Avoids repeated password/token checks after initial verification
  • Supports anonymous users (id = -1) in verified list

Access Control Flow:

  • JWT token validation on SUBSCRIBE command
  • Fallback to session-based permissions if no token
  • Token validation only on subscription, not on every message
  • Access granted via token → user added to verifiedUsers cache

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 28 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants