Skip to content

feat(hearings): add waiting room and admission controls - #1652

Open
bhavyajain0810 wants to merge 2 commits into
viru0909-dev:mainfrom
bhavyajain0810:feat/virtual-court-waiting-room-1628
Open

feat(hearings): add waiting room and admission controls#1652
bhavyajain0810 wants to merge 2 commits into
viru0909-dev:mainfrom
bhavyajain0810:feat/virtual-court-waiting-room-1628

Conversation

@bhavyajain0810

@bhavyajain0810 bhavyajain0810 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces an application-level waiting room and admission-control system for virtual court hearings.

Previously, participants could obtain or construct the Jitsi room URL and enter a hearing without waiting for the judge. This change ensures that the room identifier is disclosed only after the authenticated participant has requested access and the assigned judge has admitted them.

Changes included

  • Added participant admission states:

    • INVITED
    • WAITING
    • ADMITTED
    • REJECTED
    • EXPIRED
  • Added secure, unique participant access tokens:

    • Generated using a cryptographically secure random value
    • Stored in the database as a SHA-256 hash
    • Sent through the X-Hearing-Access-Token request header
    • Automatically expire after the hearing access window
    • Invalidated when the hearing ends
  • Added judge-controlled hearing operations:

    • Start hearing
    • View waiting participants
    • Admit participants
    • Reject participants
    • End hearing and expire participant access
  • Prevented hearing room identifiers from being exposed through regular hearing-list and hearing-detail responses.

  • Disabled the legacy direct-join endpoint.

  • Added participant waiting-room polling for litigants and lawyers.

  • Updated legacy judge hearing entry points to redirect to the secured Conduct Hearing page.

  • Added database migration V54__add_virtual_hearing_waiting_room.sql.

  • Added service and controller tests for:

    • Waiting-room requests
    • Unique participant tokens
    • Admission-based room disclosure
    • Unauthorized judge access
    • Token expiration when a hearing ends
    • Disabled legacy direct joining

Security scope

This implementation provides application-level waiting-room protection and prevents NyaySetu from disclosing the Jitsi room before admission.

Because the application currently uses the public meet.jit.si service, an admitted participant could still manually share the disclosed Jitsi room URL. Complete provider-level enforcement would require a self-hosted Jitsi secure-domain or JWT-based deployment.

Closes #1628

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

  • All eight modified frontend hearing files passed standalone esbuild syntax validation.
  • Security audit confirms predictable hearing-room fallbacks were removed from participant and legacy judge hearing pages.
  • git diff --check completed without whitespace errors.
  • Added controller and service unit tests for the waiting-room workflow.
  • Updated LiveHearing.test.jsx for the secured conduct-page navigation flow; 2/2 targeted tests pass locally.

Existing repository blockers

The complete frontend production build is currently blocked by pre-existing JSX syntax errors in VakilFriendPage.jsx, which was not modified in this PR.

Backend Maven test execution is currently blocked during production compilation by pre-existing missing NetworkNT JSON Schema classes. No new waiting-room compilation errors were reported before the baseline dependency failure.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@bhavyajain0810 is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @bhavyajain0810, thanks for contributing to Nyay Setu! 🎉

I have automatically:

  • 👤 Assigned this PR to you.
  • 🏷️ Applied the gssoc:approved label.

Our workflows will now analyze your changes to classify:

  • 📈 PR Difficulty: level:*
  • 🧩 PR Type: type:*
  • 🌟 PR Quality: quality:*

Tip

Ensure your PR description references the issue it resolves (e.g. Closes #123). This allows the bot to inherit any additional labels from that issue!

Happy coding! 🚀

@bhavyajain0810

Copy link
Copy Markdown
Contributor Author

@viru0909-dev ,

Please review the PR #1652 for issue #1628

CI update

The LiveHearing test has been updated for the new secure flow, and both related tests are passing locally.

The remaining failures appear to be unrelated to this PR:

  • Backend tests are failing because com.networknt.schema is missing in the existing Groq validator files.
  • Frontend tests still have an existing failure in CaseDetailPage.jsx.
  • NLP tests are failing even though this PR does not modify any NLP files.
  • The migration linter is checking the existing README.md as if it were a migration file.
  • Vercel deployment needs approval from a project team member.

I have not changed any unrelated files just to bypass these checks.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Virtual court video session link is shown to all parties simultaneously — no waiting room or admit control

1 participant