Skip to content

Commit

Permalink
Update protocol and add nonce to SendDataRequest (#97)
Browse files Browse the repository at this point in the history
* Update protocol and add nonce to SendDataRequest

* typo

* Fix spotless

* Create happy-pillows-relate.md

* Add missing import
  • Loading branch information
lukasIO authored Jan 28, 2025
1 parent b8aea91 commit 0f989eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-pillows-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"server-sdk-kotlin": patch
---

Update protocol and add nonce to SendDataRequest
2 changes: 1 addition & 1 deletion protocol
Submodule protocol updated 90 files
+1 −1 .github/workflows/generate.yaml
+84 −0 CHANGELOG.md
+63 −0 auth/grants.go
+50 −45 go.mod
+103 −198 go.sum
+29 −31 infra/link.pb.go
+1 −0 ingress/errors.go
+3 −0 ingress/validation.go
+35 −0 ingress/validation_test.go
+2 −0 livekit/attrs.go
+151 −143 livekit/livekit_agent.pb.go
+41 −48 livekit/livekit_agent_dispatch.pb.go
+52 −62 livekit/livekit_analytics.pb.go
+82 −0 livekit/livekit_egress.go
+933 −800 livekit/livekit_egress.pb.go
+193 −190 livekit/livekit_egress.twirp.go
+385 −358 livekit/livekit_ingress.pb.go
+93 −91 livekit/livekit_ingress.twirp.go
+33 −38 livekit/livekit_internal.pb.go
+45 −36 livekit/livekit_metrics.pb.go
+1,908 −1,170 livekit/livekit_models.pb.go
+186 −192 livekit/livekit_room.pb.go
+82 −82 livekit/livekit_room.twirp.go
+397 −343 livekit/livekit_rtc.pb.go
+1,435 −789 livekit/livekit_sip.pb.go
+174 −142 livekit/livekit_sip.twirp.go
+12 −13 livekit/livekit_webhook.pb.go
+201 −11 livekit/sip.go
+324 −1 livekit/sip_test.go
+74 −1 livekit/types.go
+71 −0 livekit/types_test.go
+15 −1 logger/slog.go
+18 −17 logger/zaputil/deferrer.go
+2 −2 package.json
+4 −2 packages/javascript/.gitignore
+108 −0 packages/javascript/CHANGELOG.md
+11 −0 packages/javascript/build.config.js
+19 −13 packages/javascript/package.json
+8 −7 packages/javascript/src/index.d.ts
+2,029 −107 pnpm-lock.yaml
+8 −2 protobufs/livekit_egress.proto
+6 −4 protobufs/livekit_ingress.proto
+5 −0 protobufs/livekit_metrics.proto
+77 −3 protobufs/livekit_models.proto
+3 −1 protobufs/livekit_room.proto
+123 −8 protobufs/livekit_sip.proto
+22 −8 protobufs/rpc/io.proto
+20 −2 protobufs/rpc/sip.proto
+11 −11 replay/cloud_replay.pb.go
+26 −30 rpc/agent.pb.go
+5 −5 rpc/agent_dispatch.pb.go
+5 −5 rpc/analytics.pb.go
+39 −31 rpc/egress.pb.go
+40 −47 rpc/ingress.pb.go
+428 −400 rpc/io.pb.go
+98 −91 rpc/io.psrpc.go
+10 −11 rpc/keepalive.pb.go
+5 −5 rpc/participant.pb.go
+16 −16 rpc/participant.psrpc.go
+5 −5 rpc/room.pb.go
+12 −12 rpc/room.psrpc.go
+5 −5 rpc/roommanager.pb.go
+4 −4 rpc/roommanager.psrpc.go
+18 −20 rpc/signal.pb.go
+50 −4 rpc/sip.go
+201 −111 rpc/sip.pb.go
+61 −53 rpc/sip.psrpc.go
+18 −0 rpc/sip_test.go
+1 −1 sdp/sdp.go
+202 −81 sip/sip.go
+22 −12 sip/token.go
+7 −0 utils/bitmap.go
+25 −0 utils/bitmap_test.go
+1 −1 utils/codec.go
+12 −28 utils/configobserver.go
+1 −1 utils/graph.go
+9 −14 utils/guid/id.go
+29 −13 utils/hwstats/cpu.go
+5 −0 utils/hwstats/cpu_darwin.go
+5 −0 utils/hwstats/cpu_linux.go
+4 −0 utils/hwstats/cpu_null.go
+8 −4 utils/lock_tracker_test.go
+13 −2 utils/math.go
+40 −0 utils/math_test.go
+333 −0 utils/metrics_batch_builder.go
+598 −0 utils/metrics_batch_builder_test.go
+3 −0 utils/parallel.go
+19 −0 utils/pointer/to.go
+8 −0 utils/proto.go
+17 −8 utils/timed_version.go
10 changes: 9 additions & 1 deletion src/main/kotlin/io/livekit/server/RoomServiceClient.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 LiveKit, Inc.
* Copyright 2025 LiveKit, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,6 +26,8 @@ import okhttp3.OkHttpClient
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.converter.protobuf.ProtoConverterFactory
import java.nio.ByteBuffer
import java.util.UUID
import java.util.function.Consumer
import java.util.function.Supplier

Expand Down Expand Up @@ -305,6 +307,11 @@ class RoomServiceClient(
destinationIdentities: List<String> = emptyList(),
topic: String? = null,
): Call<Void?> {
val uuid = UUID.randomUUID()
val b = ByteBuffer.wrap(ByteArray(16))
b.putLong(uuid.mostSignificantBits)
b.putLong(uuid.leastSignificantBits)

val request = with(LivekitRoom.SendDataRequest.newBuilder()) {
this.room = roomName
this.data = ByteString.copyFrom(data)
Expand All @@ -314,6 +321,7 @@ class RoomServiceClient(
if (topic != null) {
this.topic = topic
}
this.nonce = ByteString.copyFrom(b)
build()
}

Expand Down

0 comments on commit 0f989eb

Please sign in to comment.