Identity cannot be empty (#580)

This commit is contained in:
David Colburn
2022-03-30 12:53:32 -07:00
committed by GitHub
parent 3f5d4df65d
commit 26f7bb498a
2 changed files with 10 additions and 4 deletions
+4 -3
View File
@@ -5,12 +5,13 @@ import "errors"
var (
ErrEgressNotFound = errors.New("egress does not exist")
ErrEgressNotConnected = errors.New("egress not connected (redis required)")
ErrIdentityEmpty = errors.New("identity cannot be empty")
ErrMetadataExceedsLimits = errors.New("metadata size exceeds limits")
ErrOperationFailed = errors.New("operation cannot be completed")
ErrParticipantNotFound = errors.New("participant does not exist")
ErrRoomNotFound = errors.New("requested room does not exist")
ErrRoomLockFailed = errors.New("could not lock room")
ErrRoomUnlockFailed = errors.New("could not unlock room, lock token does not match")
ErrParticipantNotFound = errors.New("participant does not exist")
ErrTrackNotFound = errors.New("track is not found")
ErrWebHookMissingAPIKey = errors.New("api_key is required to use webhooks")
ErrOperationFailed = errors.New("operation cannot be completed")
ErrMetadataExceedsLimits = errors.New("metadata size exceeds limits")
)
+6 -1
View File
@@ -11,9 +11,10 @@ import (
"github.com/sebest/xff"
"github.com/gorilla/websocket"
"github.com/ua-parser/uap-go/uaparser"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/ua-parser/uap-go/uaparser"
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/routing"
@@ -84,6 +85,10 @@ func (s *RTCService) validate(r *http.Request) (livekit.RoomName, routing.Partic
return "", routing.ParticipantInit{}, http.StatusUnauthorized, err
}
if claims.Identity == "" {
return "", routing.ParticipantInit{}, http.StatusBadRequest, ErrIdentityEmpty
}
roomName := livekit.RoomName(r.FormValue("room"))
reconnectParam := r.FormValue("reconnect")
autoSubParam := r.FormValue("auto_subscribe")