Fix ingress stream key lookup and avoid nil dereference when room in auth claims doesn't match (#869)

This commit is contained in:
Benjamin Pracht
2022-08-04 16:22:55 -07:00
committed by GitHub
parent c333b7a026
commit 0cffbe69e9
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -59,7 +59,7 @@ func (s *IngressService) CreateIngress(ctx context.Context, req *livekit.CreateI
return nil, twirpAuthError(err)
}
if req.RoomName != "" && req.RoomName != string(roomName) {
return nil, twirpAuthError(err)
return nil, twirpAuthError(ErrPermissionDenied)
}
sk := utils.NewGuid("")
@@ -95,7 +95,7 @@ func (s *IngressService) UpdateIngress(ctx context.Context, req *livekit.UpdateI
return nil, twirpAuthError(err)
}
if req.RoomName != "" && req.RoomName != string(roomName) {
return nil, twirpAuthError(err)
return nil, twirpAuthError(ErrPermissionDenied)
}
if s.rpc == nil {
@@ -160,7 +160,7 @@ func (s *IngressService) ListIngress(ctx context.Context, req *livekit.ListIngre
return nil, twirpAuthError(err)
}
if req.RoomName != "" && req.RoomName != string(roomName) {
return nil, twirpAuthError(err)
return nil, twirpAuthError(ErrPermissionDenied)
}
if s.rpc == nil {