Check size limits on metadata and name set from client. (#2850)
* Send error response when update metadata fails. Keeping it simple for the first implementation. - Send error response only if request_id != 0 - Two kinds of errors notified o does not have permissions - NOT_ALLOWED o attributes exceeds size limits - INVALID_ARGUMENT * Check size limits on metadata and name set from client. Added a name length limit also. * check name length in service update participant path also * limit check in limit config * update protocol * longer keys
This commit is contained in:
@@ -819,26 +819,6 @@ func (r *Room) SetMetadata(metadata string) <-chan struct{} {
|
||||
return r.protoProxy.MarkDirty(true)
|
||||
}
|
||||
|
||||
func (r *Room) UpdateParticipantMetadata(
|
||||
participant types.LocalParticipant,
|
||||
name string,
|
||||
metadata string,
|
||||
attributes map[string]string,
|
||||
) error {
|
||||
if attributes != nil && len(attributes) > 0 {
|
||||
if err := participant.SetAttributes(attributes); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if metadata != "" {
|
||||
participant.SetMetadata(metadata)
|
||||
}
|
||||
if name != "" {
|
||||
participant.SetName(name)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Room) sendRoomUpdate() {
|
||||
roomInfo := r.ToProto()
|
||||
// Send update to participants
|
||||
|
||||
Reference in New Issue
Block a user