Repository navigation
fix: do not show the password of a plugin download URL - #1379
Open
ogulcanaydogan wants to merge 1 commit into
Open
ogulcanaydogan wants to merge 1 commit into
ogulcanaydogan wants to merge 1 commit into
Conversation
notation plugin install --url put the URL given by the user into its messages as it is. A URL with user info (https://user:pass@host/...) therefore showed the password in the parse error, in the "Downloading plugin from" line on stdout, in the download error and in the bad status and size limit errors of DownloadPluginFromURL. Use the redacted form of the URL for these messages and drop the URL from the parse error, because the error of url.Parse contains it. Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@gmail.com>
ogulcanaydogan
requested review from
NiazFK,
gokarnm,
priteshbandi,
rgnote,
shizhMSFT,
toddysm,
vaninrao10 and
yizha1
as code owners
October 26, 2026 22:17
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1379 +/- ##
==========================================
+ Coverage 80.10% 80.19% +0.09%
==========================================
Files 68 68
Lines 3076 3080 +4
==========================================
+ Hits 2464 2470 +6
+ Misses 403 402 -1
+ Partials 209 208 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #1378.
notation plugin install --urlused the URL from the user in its messages as it is, so a URL with user info showed the password in the parse error, in theDownloading plugin fromline, in the download error and in the bad status and size limit errors ofDownloadPluginFromURL.This uses
(*url.URL).Redacted()for the messages (https://user:xxxxx@host/...). The parse error no longer contains the URL, because the error ofurl.Parseembeds it. That error is nowfailed to parse plugin download URL with error: invalid URL escape "%", so the existing unit test for it is updated. The e2e test that matchesfailed to download plugin from URL https://localhost.testis not affected, since that URL has no credentials.Tests:
TestInstall: a parse error and a refused connection with credentials in the URLTestDownloadPluginFromURL_BadStatusRedactsCredentials: a 404 from a local test serverThey fail without the change.