Implement room creation flow with JWT-based session setup#10
Merged
Conversation
Implements the room creation flow per the implementation plan: - `src/lib/room/createRoom.ts` — generates RSA signing keypair, RSA-OAEP keypair, and AES-GCM room key; stores all keys in localStorage keyed by ownerId/roomId; mints a self-issued owner JWT; redirects to `/#token=<jwt>`. Public keys are never placed in the URL. - `src/components/LandingPage/LandingPage.tsx` — wires the "Start Session" button to `createRoom()` with loading/error state. - `src/lib/room/createRoom.test.ts` — comprehensive tests verifying JWT structure (role, iss, room, jti, exp−iat), localStorage contents, URL fragment format, signature correctness, and no public key leakage into URL. All 133 tests pass. Lint and build are clean. https://claude.ai/code/session_01UASxoGUhQFs33RpjEbwWRB
wmxscott
commented
Mar 23, 2026
|
|
||
| const signingKP = await generateSigningKeyPair() | ||
| const oaepKP = await generateOaepKeyPair() | ||
| const roomKey = await generateRoomKey() |
Owner
Author
There was a problem hiding this comment.
These 3 awaits can probably go in a await Promise.all
|
|
||
| await saveSigningKeyPair(signingKP.privateKey, signingKP.publicKey, ownerId) | ||
| await saveOaepKeyPair(oaepKP.privateKey, oaepKP.publicKey, ownerId) | ||
| await saveRoomKey(roomKey, roomId) |
Owner
Author
There was a problem hiding this comment.
These 3 awaits can probably go in a await Promise.all as well
…mise.all Address PR feedback: the three key generation calls and three storage calls are each independent, so run them concurrently via Promise.all to reduce latency during room creation. https://claude.ai/code/session_01UASxoGUhQFs33RpjEbwWRB
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.
Summary
This PR implements the core room creation flow for Ratifyd, enabling users to start ephemeral interview sessions. When a user clicks "Start Session" on the landing page, the system generates cryptographic keypairs, creates a room, and issues a self-signed JWT that serves as the session token.
Key Changes
New
createRoom()function (src/lib/room/createRoom.ts):ownerIdandroomId(both UUIDs)Updated LandingPage component (
src/components/LandingPage/LandingPage.tsx):createRoom()Comprehensive test suite (
src/lib/room/createRoom.test.ts):Implementation Details
room(roomId),role(OWNER),iss(ownerId), andjti(unique token ID)#token=<jwt>)useSessionhook after YjsProvider initializationhttps://claude.ai/code/session_01UASxoGUhQFs33RpjEbwWRB