Skip to content

Update HttpSourceResourceProvider to create a new HttpClient when the credentials change - #16

Merged
enf0rc3 merged 1 commit into
release/release-6.14.xfrom
cache-credentials
Oct 30, 2025
Merged

enf0rc3 merged 1 commit into
release/release-6.14.xfrom
cache-credentials

Conversation

@enf0rc3

@enf0rc3 enf0rc3 commented Oct 28, 2025 •

Copy link
Copy Markdown

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 WhenUsingNugetFeedCredentials that 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
image

After

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

…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
@enf0rc3 enf0rc3 changed the title Added Credentials to the equality comparer for PackageSource Update HttpSourceResourceProvider to create a new HttpClient when the credentials change Oct 29, 2025

@borland borland left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
enf0rc3 merged commit 06f45ed into release/release-6.14.x Oct 30, 2025
1 check passed
@enf0rc3
enf0rc3 deleted the cache-credentials branch October 31, 2025 01:26
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants