logger proto redaction. (#4090)

Unfortunately, this could not be used for twirp/analytics redaction.

Probably worth writing a proto clone utility which will filter out based
on tags.
This commit is contained in:
Raja Subramanian
2025-11-18 14:15:17 +05:30
committed by GitHub
parent 54cf7d46c8
commit 37a06821e2
3 changed files with 53 additions and 53 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ func (s *RoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomReq
redactedReq := redactCreateRoomRequest(req)
RecordRequest(ctx, redactedReq)
AppendLogFields(ctx, "room", req.Name, "request", logger.Proto(redactedReq))
AppendLogFields(ctx, "room", req.Name, "request", logger.Proto(req))
if err := EnsureCreatePermission(ctx); err != nil {
return nil, twirpAuthError(err)
} else if req.Egress != nil && s.egressLauncher == nil {
@@ -439,7 +439,7 @@ func redactSendDataRequest(req *livekit.SendDataRequest) *livekit.SendDataReques
clone := utils.CloneProto(req)
// replace with size of data to provide visibility on request size
clone.Data = []byte(fmt.Sprintf("__size: %d", len(clone.Data)))
clone.Data = fmt.Appendf(nil, "__size: %d", len(clone.Data))
return clone
}