Repository navigation
fix: decode JWT video grants from the camelCase claim keys - #1237
Merged
hiroshihorie merged 1 commit intoOct 15, 2026
Merged
Conversation
RaphaelFakhri
requested review from
changt,
cloudwebrtc,
hiroshihorie and
xianshijing-lk
as code owners
October 10, 2026 19:32
hiroshihorie
approved these changes
Oct 13, 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.
Summary
Fixes #1236.
LiveKitVideoGrantmapped its fields to snake_case keys such asroom_join,can_publishandcan_publish_sources. LiveKit tokens write thevideoclaim with camelCase keys (roomJoin,canPublish,canPublishSources), as defined inlivekit/protocolauth/grants.goand used by the server SDKs and the Android SDK. As a result,TokenSourceResponse.jwtPayload?.videoreturned null for every grant exceptroom,hiddenandrecorderwhen it decoded a real token.This change:
@JsonKeyrenames fromLiveKitVideoGrant, sojson_serializableuses the field names, which match the claim keys.jwt.g.dart.Test plan
test/token/token_source_test.dart: theparses claims and grants from tokentest and the_generateTokenhelper now build thevideoclaim with the keys that LiveKit tokens use, and the test also checkscanSubscribe.Expected: true, Actual: <null>ongrant.roomJoin. After the change it passes.flutter test test/token/,flutter analyze,dart format --set-exit-if-changedandimport_sorterpass..changesentry.