Redact mux/twitch shorthand stream keys and websocket url query values - #1713
Merged
Conversation
mux:// and twitch:// shorthand stream urls carry the stream key as the entire authority, but RedactStreamKey only matched rtmp(s):// urls, so shorthand keys passed through redaction unchanged and ended up raw in request logs. Track egress websocket urls can carry credentials in query parameters and were not redacted at all. Also fixes RedactUpload reading AssumeRoleExternalId instead of SessionToken when redacting SessionToken. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
paulwe
approved these changes
Aug 14, 2026
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RedactStreamKeynow redactsmux://andtwitch://shorthand stream urls, where the entire authority is the stream key. Previously onlyrtmp(s)://urls matched, so shorthand keys passed through redaction unchanged and were logged raw (e.g. in the egressrequest validatedlog, which redacts a clone of the start request viaRedactEncodedOutputsbefore logging).RedactDirectOutputsnow redacts query parameter values in track egress websocket urls via a newutils.RedactUrlQueryValueshelper. Websocket output urls commonly carry credentials in query parameters (token=,signature=, ...); parameter names are kept for debuggability.RedactUploadreadingAssumeRoleExternalIdinstead ofSessionTokenwhen redactingSessionToken— a set session token with an empty external id was cleared to""instead of showing the{session_token}placeholder.Test plan
TestRedactStreamOutputwith mux/twitch shorthand casesTestRedactDirectOutputwith a websocket url query redaction caseTestRedactUploadwith a session-token-without-external-id case🤖 Generated with Claude Code