Repository navigation
fix: clear stale password when auth is replaced without one - #244
Open
RealBhupesh wants to merge 2 commits into
Open
RealBhupesh wants to merge 2 commits into
RealBhupesh wants to merge 2 commits into
Conversation
A complete username-only auth value must not retain the previous password. Assisted-by: LLM
Check username-only, empty and encoded auth values against an existing password. Assisted-by: LLM
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.
Replacing the complete
authvalue with a username-only value currently keeps the old password:The no-colon branch updates
usernamebut notpassword. This clearspasswordthere, soauth,hrefandtoString()reflect the full replacement. Settingauthto an empty string also clears the previous credentials. This intentionally changes stale-password retention; callers intending to change only the username should useset('username', ...)instead.The existing sequential auth test clears the password with
'baz:'before checking username-only'qux', so it misses this case. Added a regression with fresh password-bearing URLs for username-only, empty and percent-encoded username auth values (18 assertions). It fails against the original source at the first stale-password check.Validation:
npm testpasses all 102 tests, with 100% statements/functions/lines and 99.02% branches (existing branches at lines 102/104). No browser/Sauce Labs run. Colon-containing auth parsing and malformed-percent exceptions are unchanged; this is not a broader URL security fix.No dependencies or unrelated files changed. AI assistance is recorded in both commit trailers.