Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
912b438
Add data track schema fields
ladvoc Apr 24, 2026
64f12c0
generated protobuf
github-actions[bot] Apr 24, 2026
1eb2493
fix change set for eot changes (#1515)
chenghao-mou Apr 24, 2026
a188dfa
Version Packages (#1517)
github-actions[bot] Apr 24, 2026
74d57bc
codegen observability parent tx accessors (#1522)
paulwe Apr 29, 2026
8ecfae6
update otel (#1524)
paulwe Apr 29, 2026
4282c36
Fix the egress results serialization format (#1521)
biglittlebigben Apr 29, 2026
3d65104
TEL-543: handle trunk validation with duplicated numbers or allowed n…
hechen-eng Apr 29, 2026
21b472c
add agents reporter with env (#1525)
paulwe Apr 29, 2026
7851969
feat(agents): add session events for amd (#1526)
chenghao-mou May 1, 2026
541caf3
add agent environment (#1527)
paulwe May 2, 2026
4310bff
add duration seconds reporting (#1528)
paulwe May 2, 2026
b530300
update observability codegen for ingress/egress (#1529)
paulwe May 2, 2026
6992144
Version Packages (#1523)
github-actions[bot] May 5, 2026
b94e478
update room reporter (#1531)
barrust May 5, 2026
bb8caba
rename agent environment to deployment (#1532)
paulwe May 5, 2026
fe1a02a
Allow setting a list of SIP codecs for SDP. (#1530)
dennwc May 6, 2026
7e22e7e
add eot obs (#1535)
shishirng May 6, 2026
5005b96
fix: ensure we don't reject tokens with unknown fields (#1536)
davidzhao May 6, 2026
60b1c93
Version Packages (#1533)
github-actions[bot] May 6, 2026
06d2b94
Add tags, duration_ms, scenario_id, started_at to SimulationRun.Job (…
theomonnom May 6, 2026
ab21967
Replace duration_ms with ended_at on SimulationRun.Job (#1538)
theomonnom May 6, 2026
f11ffac
fix panic in sip (#1539)
hechen-eng May 6, 2026
fb06fb5
Add room_name to SimulationRun.Job (#1541)
theomonnom May 7, 2026
619b195
add local protojson with permissive defaults (#1542)
paulwe May 7, 2026
51b9f22
Add missing fields to SimulationRun and ScenarioGroup (#1544)
theomonnom May 7, 2026
7a8fb6f
fix SIP trunk-level MediaEncryption being silently dropped (#1540)
hechen-eng May 7, 2026
e3b71b1
feat: update obs schemas (#1545)
anunaym14 May 7, 2026
93c9d73
Add passed_count, failed_count to SimulationRun (#1546)
theomonnom May 7, 2026
48b0794
Add num_simulations to SimulationRun (#1547)
theomonnom May 8, 2026
fb9e1b1
Update corecall reporter (#1548)
barrust May 12, 2026
2ae8df7
Update ingress reporter (#1549)
barrust May 12, 2026
6066a37
ingress_id part of start time index (#1550)
barrust May 12, 2026
3210962
room obs - participant attributes (#1551)
shishirng May 12, 2026
0573e14
v3: ingress remove audio and video enabled reporting (#1552)
barrust May 12, 2026
aa1eee3
New registration approach
ladvoc Apr 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/great-birds-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/protocol": patch
---

add local protojson with permissive defaults
5 changes: 0 additions & 5 deletions .changeset/many-seas-fry.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/sip-fix-trunk-encryption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@livekit/protocol": patch
"github.com/livekit/protocol": patch
---

Fix SIP trunk-level MediaEncryption being silently dropped on outbound and inbound calls. The early `req.Upgrade()` / `rule.Upgrade()` calls pinned `Media.Encryption` to the (legacy) request/rule field before the trunk's MediaEncryption was merged, causing INVITEs to omit SRTP when only the trunk had it configured.
2 changes: 1 addition & 1 deletion .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ">=1.20"
go-version: ">=1.26"

- name: Go mod tidy
run: go mod tidy
Expand Down
12 changes: 12 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@ version: "2"
linters:
default: none
enable:
- depguard
- staticcheck
settings:
depguard:
rules:
protojson:
files:
- "$all"
- "!**/utils/protojson/**"
deny:
- pkg: google.golang.org/protobuf/encoding/protojson
desc: use github.com/livekit/protocol/utils/protojson instead — it sets DiscardUnknown by default to avoid schema-drift footguns
staticcheck:
checks:
- "all"
Expand All @@ -14,3 +24,5 @@ linters:
- "-ST1022"
- "-SA1019"
- "-QF1008"
exclusions:
generated: strict
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# github.com/livekit/protocol

## 1.45.8

### Patch Changes

- Allow setting a list of SIP codecs for SDP. - [#1530](https://github.com/livekit/protocol/pull/1530) ([@dennwc](https://github.com/dennwc))

- fix: ensure we don't reject tokens on unknown fields - [#1536](https://github.com/livekit/protocol/pull/1536) ([@davidzhao](https://github.com/davidzhao))

## 1.45.7

### Patch Changes

- feat(agents): add session events for amd - [#1526](https://github.com/livekit/protocol/pull/1526) ([@chenghao-mou](https://github.com/chenghao-mou))

## 1.45.6

### Patch Changes

- Add turn detection protobufs - [#1485](https://github.com/livekit/protocol/pull/1485) ([@chenghao-mou](https://github.com/chenghao-mou))

- fix change set for eot changes - [#1515](https://github.com/livekit/protocol/pull/1515) ([@chenghao-mou](https://github.com/chenghao-mou))

## 1.45.5

## 1.45.4
Expand Down
24 changes: 24 additions & 0 deletions agent/environment.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package agent

import "fmt"

const MaxDeploymentLength = 64

func ValidateDeployment(deployment string) error {
if deployment == "" {
return nil
}
if len(deployment) > MaxDeploymentLength {
return fmt.Errorf("deployment exceeds %d bytes", MaxDeploymentLength)
}
for i := 0; i < len(deployment); i++ {
c := deployment[i]
switch {
case c == '_':
return fmt.Errorf("deployment contains reserved character %q", c)
case c <= ' ' || c == 0x7f:
return fmt.Errorf("deployment contains whitespace or control byte at position %d", i)
}
}
return nil
}
8 changes: 2 additions & 6 deletions auth/grants.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/exp/slices"
"google.golang.org/protobuf/encoding/protojson"

"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/utils"
"github.com/livekit/protocol/utils/protojson"
)

type RoomConfiguration livekit.RoomConfiguration

var tokenMarshaler = protojson.MarshalOptions{
EmitDefaultValues: false,
}

var ErrSensitiveCredentials = errors.New("room configuration should not contain sensitive credentials")

func (c *RoomConfiguration) Clone() *RoomConfiguration {
Expand All @@ -45,7 +41,7 @@ func (c *RoomConfiguration) Clone() *RoomConfiguration {
}

func (c *RoomConfiguration) MarshalJSON() ([]byte, error) {
return tokenMarshaler.Marshal((*livekit.RoomConfiguration)(c))
return protojson.Marshal((*livekit.RoomConfiguration)(c))
}

func (c *RoomConfiguration) UnmarshalJSON(data []byte) error {
Expand Down
47 changes: 47 additions & 0 deletions auth/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import (
"testing"
"time"

"github.com/go-jose/go-jose/v3"
"github.com/go-jose/go-jose/v3/json"
"github.com/go-jose/go-jose/v3/jwt"
"github.com/stretchr/testify/require"

"github.com/livekit/protocol/auth"
Expand Down Expand Up @@ -95,6 +97,51 @@ func TestVerifier(t *testing.T) {
require.EqualValues(t, attrs, decoded.Attributes)
})

t.Run("unknown fields are ignored for forward compatibility", func(t *testing.T) {
// Simulate a token issued by a newer client whose claims include fields
// this server does not yet know about. The server should still accept the
// token rather than failing with `unknown field`. This guards against
// requiring server upgrades before client upgrades can roll out.
sig, err := jose.NewSigner(
jose.SigningKey{Algorithm: jose.HS256, Key: []byte(secret)},
(&jose.SignerOptions{}).WithType("JWT"),
)
require.NoError(t, err)

claims := map[string]interface{}{
"iss": apiKey,
"sub": "me",
"nbf": jwt.NewNumericDate(time.Now()),
"exp": jwt.NewNumericDate(time.Now().Add(time.Minute)),
// unknown top-level claim grants field
"someFutureGrant": map[string]interface{}{"enabled": true},
"video": map[string]interface{}{
"roomJoin": true,
"room": "myroom",
// unknown field inside a known grant
"someFutureVideoField": "future-value",
},
"roomConfig": map[string]interface{}{
"name": "myroom",
// unknown field inside a protojson-decoded message
"someFutureRoomConfigField": "future-value",
},
}
token, err := jwt.Signed(sig).Claims(claims).CompactSerialize()
require.NoError(t, err)

v, err := auth.ParseAPIToken(token)
require.NoError(t, err)

_, decoded, err := v.Verify(secret)
require.NoError(t, err)
require.NotNil(t, decoded.Video)
require.Equal(t, "myroom", decoded.Video.Room)
require.True(t, decoded.Video.RoomJoin)
require.NotNil(t, decoded.RoomConfig)
require.Equal(t, "myroom", decoded.RoomConfig.Name)
})

t.Run("nil permissions are handled", func(t *testing.T) {
grant := &auth.VideoGrant{
Room: "myroom",
Expand Down
42 changes: 21 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/livekit/protocol

go 1.25.0
go 1.26

require (
buf.build/go/protoyaml v0.6.0
Expand Down Expand Up @@ -30,28 +30,28 @@ require (
github.com/stretchr/testify v1.11.1
github.com/twitchtv/twirp v8.1.3+incompatible
github.com/zeebo/xxh3 v1.0.2
go.opentelemetry.io/otel v1.40.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0
go.opentelemetry.io/otel/sdk v1.40.0
go.opentelemetry.io/otel/trace v1.40.0
go.opentelemetry.io/otel v1.43.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.43.0
go.opentelemetry.io/otel/sdk v1.43.0
go.opentelemetry.io/otel/trace v1.43.0
go.uber.org/atomic v1.11.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
go.uber.org/zap/exp v0.3.0
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
golang.org/x/mod v0.29.0
golang.org/x/sys v0.40.0
golang.org/x/text v0.31.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217
google.golang.org/grpc v1.77.0
google.golang.org/protobuf v1.36.10
golang.org/x/mod v0.34.0
golang.org/x/sys v0.43.0
golang.org/x/text v0.36.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20260427160629-7cedc36a6bc4
google.golang.org/grpc v1.80.0
google.golang.org/protobuf v1.36.11
gopkg.in/yaml.v3 v3.0.1
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250625184727-c923a0c2a132.1 // indirect
buf.build/go/protovalidate v0.13.1 // indirect
cel.dev/expr v0.24.0 // indirect
cel.dev/expr v0.25.1 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
Expand All @@ -61,7 +61,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/cel-go v0.25.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
Expand All @@ -88,12 +88,12 @@ require (
github.com/stoewer/go-strcase v1.3.1 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/tools v0.38.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
golang.org/x/crypto v0.50.0 // indirect
golang.org/x/net v0.53.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/tools v0.43.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260427160629-7cedc36a6bc4 // indirect
)
Loading
Loading