Enable Room.List to filter by specific names (#290)
This commit is contained in:
@@ -58,7 +58,7 @@ func setupSingleNodeTest(name string, roomName string) (*service.LivekitServer,
|
||||
waitForServerToStart(s)
|
||||
|
||||
// create test room
|
||||
_, err := roomClient.CreateRoom(contextWithCreateRoomToken(), &livekit.CreateRoomRequest{Name: roomName})
|
||||
_, err := roomClient.CreateRoom(contextWithToken(createRoomToken()), &livekit.CreateRoomRequest{Name: roomName})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -86,9 +86,9 @@ func setupMultiNodeTest(name string) (*service.LivekitServer, *service.LivekitSe
|
||||
}
|
||||
}
|
||||
|
||||
func contextWithCreateRoomToken() context.Context {
|
||||
func contextWithToken(token string) context.Context {
|
||||
header := make(http.Header)
|
||||
testclient.SetAuthorizationToken(header, createRoomToken())
|
||||
testclient.SetAuthorizationToken(header, token)
|
||||
tctx, err := twirp.WithHTTPRequestHeaders(context.Background(), header)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -258,6 +258,16 @@ func createRoomToken() string {
|
||||
return t
|
||||
}
|
||||
|
||||
func listRoomToken() string {
|
||||
at := auth.NewAccessToken(testApiKey, testApiSecret).
|
||||
AddGrant(&auth.VideoGrant{RoomList: true})
|
||||
t, err := at.ToJWT()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
func stopWriters(writers ...*testclient.TrackWriter) {
|
||||
for _, w := range writers {
|
||||
w.Stop()
|
||||
|
||||
Reference in New Issue
Block a user