-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redact sensitive information in redirected URLs (#1408)
* Redact sensitive information in redirected URLs This adds internal methods to redact potentially sensitive information from URLs in error messages, especially when those URLs are the result of server-side redirects. We already redact potentially sensitive information like this as part of transport.CheckError, but this isn't called when the error is the result of an http.Client.Do (e.g., tcp dial error). The specific use case where this can happen is a registry like GCR which redirects blob requests to GCS with a sensitive access_token in the query parameter. If the request to GCS fails due to tcp error, the error message will include the sensitive access token. This method of redaction relies on the original error being a *url.Error, and redaction is accomplished by simply updating the error's URL with a redacted equivalent. * review feedback
- Loading branch information
Showing
4 changed files
with
102 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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