Repository navigation
Redact query strings from logged and raised request URLs - #76
Merged
Merged
Conversation
Presigned upload URLs (e.g. the S3 `zip_url` / `uploadURL` returned by the API) carry signatures and temporary AWS session tokens in their query string. The CLI prints these URLs in full in some situations: - `upload snapshots --debug` logs the upload URL - On errors, the URL is printed even with no `--debug` flag CLI output frequently lands in public CI logs, so anyone reading the log could use the URL to upload arbitrary content until it expires. This adds `Network.redact_uri`, which replaces the query string with `[REDACTED]`, and use it everywhere a request URL is logged or included in an exception message.
trevor-e
approved these changes
Nov 13, 2026
Merged
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.
Problem
Presigned upload URLs returned by the API (
zip_url,uploadURL) carry signatures and temporary AWS session tokens in their query string.The CLI prints these URLs in full in some situations:
--debuglogs the upload URL--debugflagCLI output often ends up in public CI logs, so anyone reading the log can use the URL to upload content until it expires.
Change
Network.redact_uri, which replaces the query string with[REDACTED].test/utils/network_test.rb.The redaction applies to every request URL, not only presigned ones. Emerge API query parameters aren't sensitive, but hiding them costs little debugging detail and keeps the rule simple.
Testing
bundle exec rake test: 55 tests pass.rubocopreports no offenses on the changed files.