Repository navigation
Update HttpSourceResourceProvider to create a new HttpClient when the credentials change - #16
Merged
Merged
Conversation
…when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. Fixes NuGet/Home#4427 This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
borland
approved these changes
Oct 30, 2025
borland
left a comment
There was a problem hiding this comment.
LGTM. We paired on zoom; my main concern was does PackageSourceCredential implement equality? And yes it does, we looked at the code in upstream.
enf0rc3
added a commit
that referenced
this pull request
Feb 23, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
enf0rc3
added a commit
that referenced
this pull request
Feb 25, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
enf0rc3
added a commit
that referenced
this pull request
Feb 25, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
enf0rc3
added a commit
that referenced
this pull request
Feb 25, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
enf0rc3
added a commit
that referenced
this pull request
Feb 25, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
enf0rc3
added a commit
that referenced
this pull request
Apr 17, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
enf0rc3
added a commit
that referenced
this pull request
Apr 21, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
enf0rc3
added a commit
that referenced
this pull request
Nov 6, 2026
… credentials change (#16) Added Credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change. Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value. This was a re-implementation of dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3 (cherry picked from commit 19f95b6)
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.
Background
To support existing functionality and in regards to the HTTP Client Caching within Octopus Deploy we need to re-implement the following commits:
dd0d988#diff-2e2f5bc7aba32eb58bd35315bbc3322399bbf8efd6e84fe7ef1bd95b45dab6a3
We have implemented a new integration test file within octopus deploy called
WhenUsingNugetFeedCredentialsthat covers this case to verify that the current release without the changes from above commit applied.The original rationale was in this issue: OctopusDeploy/Issues#2959 and the proposed fix at the time was ignored so a decision was made to "override" the proxy instead to insulate us from the ProxyCache.
Result
As 6.14 has diverged, another individual has implemented some of the equality changes, so we didn't need to make all the same changes, but we did add some further unit tests.
This pr has added credentials to the equality comparer for PackageSource so that when HttpSourceResourceProvider caches HttpClients, it creates a new client when the credentials change.
Previously it was returning the same HttpClient (which already has credentials set) regardles of the PackageSource.Credentails value.
Before
Version: 6.14.1-release.3601

After
Version: 6.14.1-xprivate.3801 (this PR branch build)
