mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 00:02:53 +00:00
Use cloned grants. (#2586)
To ensure no pointer (i. e. mutable object) is held in returned proto.
This commit is contained in:
1 parent
9e5f434cef
commit
e85922857a
1 file changed
+5
-4
@@ -503,19 +503,20 @@ func (p *ParticipantImpl) ToProtoWithVersion() (*livekit.ParticipantInfo, utils.
|
||||
p.timedVersion.Update(&piv)
|
||||
}
|
||||
|
||||
grants := p.ClaimGrants()
|
||||
p.lock.RLock()
|
||||
pi := &livekit.ParticipantInfo{
|
||||
Sid: string(p.params.SID),
|
||||
Identity: string(p.params.Identity),
|
||||
Name: p.grants.Name,
|
||||
Name: grants.Name,
|
||||
State: p.State(),
|
||||
JoinedAt: p.ConnectedAt().Unix(),
|
||||
Version: v,
|
||||
Permission: p.grants.Video.ToPermission(),
|
||||
Metadata: p.grants.Metadata,
|
||||
Permission: grants.Video.ToPermission(),
|
||||
Metadata: grants.Metadata,
|
||||
Region: p.params.Region,
|
||||
IsPublisher: p.IsPublisher(),
|
||||
Kind: p.grants.GetParticipantKind(),
|
||||
Kind: grants.GetParticipantKind(),
|
||||
}
|
||||
p.lock.RUnlock()
|
||||
|
||||
|
||||
Reference in new issue
Block a user