Skip to content

Commit de36203

Browse files
Add Ingress OutOfNetwork attribute keys. Add the CanUpdateOwnMetadata claim to the ingress token (#965)
1 parent 07992dd commit de36203

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.changeset/thin-coats-wait.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/protocol": patch
3+
---
4+
5+
Add Ingress OutOfNetwork attribute keys. Add the CanUpdateOwnMetadata claim to the ingress token

ingress/token.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ func BuildIngressToken(apiKey, secret, roomName, participantIdentity, participan
2525
f := false
2626
t := true
2727
grant := &auth.VideoGrant{
28-
RoomJoin: true,
29-
Room: roomName,
30-
CanSubscribe: &f,
31-
CanPublish: &t,
28+
RoomJoin: true,
29+
Room: roomName,
30+
CanSubscribe: &f,
31+
CanPublish: &t,
32+
CanUpdateOwnMetadata: &t,
3233
}
3334

3435
at := auth.NewAccessToken(apiKey, secret).

livekit/attrs.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ const (
2222
AttrSIPCallStatus = AttrSIPPrefix + "callStatus"
2323
// AttrSIPHeaderPrefix is a prefix for automatically mapped SIP header attributes.
2424
AttrSIPHeaderPrefix = AttrSIPPrefix + "h."
25+
26+
// AttrIngressPrefix is shared for all Ingress attributes
27+
AttrIngressPrefix = "ingress."
28+
// AttrIngressOutOfNetworkPrefix is shared for all ingress out of network (Ads break) related attributes
29+
AttrIngressOutOfNetworkPrefix = AttrIngressPrefix + "outOfNetwork."
30+
// AttrIngressOutOfNetworkEventID contains the event ID of the current Out of network splice
31+
AttrIngressOutOfNetworkEventID = AttrIngressOutOfNetworkPrefix + "eventID"
2532
)

0 commit comments

Comments
 (0)