Ability to set name on Participant (#293)
This commit is contained in:
@@ -228,7 +228,9 @@ func redisClient() *redis.Client {
|
||||
func joinToken(room, name string) string {
|
||||
at := auth.NewAccessToken(testApiKey, testApiSecret).
|
||||
AddGrant(&auth.VideoGrant{RoomJoin: true, Room: room}).
|
||||
SetIdentity(name)
|
||||
SetIdentity(name).
|
||||
SetName(name).
|
||||
SetMetadata("metadata" + name)
|
||||
t, err := at.ToJWT()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -239,7 +241,8 @@ func joinToken(room, name string) string {
|
||||
func joinTokenWithGrant(name string, grant *auth.VideoGrant) string {
|
||||
at := auth.NewAccessToken(testApiKey, testApiSecret).
|
||||
AddGrant(grant).
|
||||
SetIdentity(name)
|
||||
SetIdentity(name).
|
||||
SetName(name)
|
||||
t, err := at.ToJWT()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -249,8 +252,7 @@ func joinTokenWithGrant(name string, grant *auth.VideoGrant) string {
|
||||
|
||||
func createRoomToken() string {
|
||||
at := auth.NewAccessToken(testApiKey, testApiSecret).
|
||||
AddGrant(&auth.VideoGrant{RoomCreate: true}).
|
||||
SetIdentity("testuser")
|
||||
AddGrant(&auth.VideoGrant{RoomCreate: true})
|
||||
t, err := at.ToJWT()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
@@ -52,6 +52,10 @@ func TestMultiNodeRouting(t *testing.T) {
|
||||
require.Equal(t, c1.ID(), streamID)
|
||||
return true
|
||||
})
|
||||
|
||||
remoteC1 := c2.GetRemoteParticipant(c1.ID())
|
||||
require.Equal(t, "c1", remoteC1.Name)
|
||||
require.Equal(t, "metadatac1", remoteC1.Metadata)
|
||||
}
|
||||
|
||||
func TestConnectWithoutCreation(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user