Repository navigation
[repo-assist] Fix trailing slash mismatch in credential/token source lookup (#3592) - #4369
Merged
dsyme merged 1 commit intoAug 27, 2026
Conversation
…e lookup Stored credential/token sources have their trailing slash stripped by AddCredentials, but GetAuthenticationForUrl/getSourceNodes compared the raw (possibly slash-terminated) push/source URL against the stored value with exact string equality. This caused paket push to silently fail to find matching credentials (401 Unauthorized) whenever the URL used at push time had a trailing slash that didn't match storage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsyme
marked this pull request as ready for review
August 27, 2026 14:55
17 tasks
This was referenced Oct 5, 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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #3592
Root cause
AddCredentials(ConfigFile.fs) strips the trailing slash from a source URL before storing it inpaket.config:However,
getSourceNodes/GetAuthenticationForUrlcompared the raw lookup source (as passed atpaket pushtime, which may or may not have a trailing slash) against the stored value with exact string equality:This meant a credential/token stored for
(example.com/redacted) (slash stripped on save) would never match a lookup for(example.com/redacted) (slash present, e.g. because it came from a NuGet v2 feed JSON response), causingpaket pushto silently skip the stored credentials and fail with401 Unauthorized, as reported in #3592.Fix
getSourceNodesnow trims trailing/from both the lookup source and each stored source attribute before comparing, so a stored/looked-up source pair matches regardless of trailing-slash presence.Trade-offs
AddCredentials's trimming behavior on save, to avoid altering existingpaket.configfiles.Test Status
dotnet build src/Paket.Core/Paket.Core.fsproj -f netstandard2.0→ succeeded, 0 errors.get source nodes ignores trailing slash mismatchintests/Paket.Tests/Versioning/ConfigFileSpecs.fs.dotnet test tests/Paket.Tests/Paket.Tests.fsproj --filter "FullyQualifiedName~ConfigFileSpecs"→ 3/3 passed on net9.0 (2 pre-existing tests skipped on this sandbox only because they require WindowsProtectedData.Protectfor encryption; net461 host could not run due to missingmonoin this sandbox — infrastructure limitation, not related to this change).Add this agentic workflow to your repo
To install this agentic workflow, run