Support for participant attributes (#2806)

* Support for participant attributes

* move metadata setters to LocalParticipant

* address feedback

* forward error

* update go mod

* update attributes first
This commit is contained in:
David Zhao
2024-06-19 23:14:19 -07:00
committed by GitHub
parent d4e50b633f
commit 7a774cc82a
24 changed files with 388 additions and 142 deletions
+6 -6
View File
@@ -34,7 +34,7 @@ import (
func TestDeleteRoom(t *testing.T) {
t.Run("missing permissions", func(t *testing.T) {
svc := newTestRoomService(config.RoomConfig{})
svc := newTestRoomService(config.LimitConfig{})
grant := &auth.ClaimGrants{
Video: &auth.VideoGrant{},
}
@@ -48,7 +48,7 @@ func TestDeleteRoom(t *testing.T) {
func TestMetaDataLimits(t *testing.T) {
t.Run("metadata exceed limits", func(t *testing.T) {
svc := newTestRoomService(config.RoomConfig{MaxMetadataSize: 5})
svc := newTestRoomService(config.LimitConfig{MaxMetadataSize: 5})
grant := &auth.ClaimGrants{
Video: &auth.VideoGrant{},
}
@@ -72,8 +72,8 @@ func TestMetaDataLimits(t *testing.T) {
})
notExceedsLimitsSvc := map[string]*TestRoomService{
"metadata noe exceeds limits": newTestRoomService(config.RoomConfig{MaxMetadataSize: 5}),
"metadata no limits": newTestRoomService(config.RoomConfig{}), // no limits
"metadata noe exceeds limits": newTestRoomService(config.LimitConfig{MaxMetadataSize: 5}),
"metadata no limits": newTestRoomService(config.LimitConfig{}), // no limits
}
for n, s := range notExceedsLimitsSvc {
@@ -104,12 +104,12 @@ func TestMetaDataLimits(t *testing.T) {
}
}
func newTestRoomService(conf config.RoomConfig) *TestRoomService {
func newTestRoomService(limitConf config.LimitConfig) *TestRoomService {
router := &routingfakes.FakeRouter{}
allocator := &servicefakes.FakeRoomAllocator{}
store := &servicefakes.FakeServiceStore{}
svc, err := service.NewRoomService(
conf,
limitConf,
config.APIConfig{ExecutionTimeout: 2},
rpc.PSRPCConfig{},
router,