Skip to content

livekit-api: add the kind and inference claims to AccessToken - #1380

Open
theomonnom wants to merge 2 commits into
mainfrom
theo/access-token-kind-inference
Open

livekit-api: add the kind and inference claims to AccessToken#1380
theomonnom wants to merge 2 commits into
mainfrom
theo/access-token-kind-inference

Conversation

@theomonnom

@theomonnom theomonnom commented Aug 31, 2026

Copy link
Copy Markdown
Member

No description provided.

@theomonnom
theomonnom requested a review from ladvoc as a code owner August 31, 2026 02:01

@devin-ai-integration devin-ai-integration Bot left a comment

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.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@xianshijing-lk xianshijing-lk left a comment

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.

Thanks

Claims carries exp, iss, nbf, sub, name, video, sip, sha256, metadata,
attributes and room_config. The Python SDK has two more that Rust cannot
express (livekit/api/access_token.py:84,96,161,169):

  - kind, the participant kind. An agent that joins a room without
    kind: "agent" is counted as a user, which makes a caller-room disconnect
    handler treat a transferring agent as the caller.
  - inference, the grant the LiveKit Inference gateway checks.

Callers that need either mint the JWT themselves today, with their own claim
struct and their own jsonwebtoken dependency.

Both new fields skip when unset. Claims has no other skip_serializing_if -- it
already emits name:"", metadata:"", attributes:{} and roomConfig:null on every
token -- so without the skip every token minted through this SDK would silently
grow two claims. That is what the second test pins. The verify path needs no
change: Claims is #[serde(default)].
@theomonnom
theomonnom force-pushed the theo/access-token-kind-inference branch from 81cc721 to 6ab8ffa Compare August 31, 2026 03:12
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Changeset ✓

This PR includes a changeset covering all affected packages:

Package Bump
livekit patch
livekit-api patch
livekit-ffi patch
livekit-signaling patch
livekit-token patch
livekit-uniffi patch

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