Redact stream keys in UpdateStream API log fields (#4763)
* Redact stream keys in UpdateStream API log fields UpdateStream add/remove urls were logged raw into the API request log, including rtmp stream keys and mux/twitch shorthand keys. Redact them with utils.RedactStreamKey before appending log fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Bump protocol for query-value redaction fallback Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
035bef4111
commit
b0e2d89826
@@ -319,8 +319,16 @@ func (s *EgressService) UpdateLayout(ctx context.Context, req *livekit.UpdateLay
|
||||
return info, nil
|
||||
}
|
||||
|
||||
func redactedStreamUrls(urls []string) []string {
|
||||
redacted := make([]string, len(urls))
|
||||
for i, u := range urls {
|
||||
redacted[i], _ = utils.RedactStreamKey(u)
|
||||
}
|
||||
return redacted
|
||||
}
|
||||
|
||||
func (s *EgressService) UpdateStream(ctx context.Context, req *livekit.UpdateStreamRequest) (*livekit.EgressInfo, error) {
|
||||
AppendLogFields(ctx, "egressID", req.EgressId, "addUrls", req.AddOutputUrls, "removeUrls", req.RemoveOutputUrls)
|
||||
AppendLogFields(ctx, "egressID", req.EgressId, "addUrls", redactedStreamUrls(req.AddOutputUrls), "removeUrls", redactedStreamUrls(req.RemoveOutputUrls))
|
||||
if err := EnsureRecordPermission(ctx); err != nil {
|
||||
return nil, twirpAuthError(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user