Skip to content

replay: sign replay requests with the roomRecord grant - #1053

Draft
milos-lk wants to merge 1 commit into
mainfrom
milos/replay-room-record-grant
Draft

milos-lk wants to merge 1 commit into
mainfrom
milos/replay-room-record-grant

Conversation

@milos-lk

Copy link
Copy Markdown
Contributor

lk replay signs its requests with the roomRecord grant, the same grant the egress commands use, in place of roomAdmin.

Note for reviewers: roomRecord is chosen to match egress, since replay export produces an egress. If replay should have its own grant instead, please say so; this change would then switch to that grant once it exists in protocol.

What changes

  • The replay client token carries roomRecord instead of roomAdmin. Session projects work the same way: the Public API mints the token with the requested grants, as it already does for lk egress.

Tests

  • go build ./cmd/lk. Not exercised against a live project.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milos-lk
milos-lk marked this pull request as draft October 17, 2026 13:33
@milos-lk
milos-lk requested a review from a team October 17, 2026 13:33
Comment thread cmd/lk/replay.go
// The replay service requires roomRecord. For a session project, the session
// hook (withDefaultClientOpts) swaps this token for one the Public API mints
// with the same grants.
at := auth.NewAccessToken(c.apiKey, c.apiSecret).SetVideoGrant(&auth.VideoGrant{RoomRecord: true})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think replay might have to create a room if it does not exist. Might need the admin grant for that. Don't remember exactly though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

export should be fine but playback might indeed need it - @frostbyte73 could you weight in here? 🙏

@milos-lk
milos-lk requested a review from frostbyte73 October 17, 2026 13:42
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.

2 participants