Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(provider/docker): Support multiple challenges from WWW-Authenticate header (backport #6139) #6175

Merged
merged 1 commit into from Mar 27, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 27, 2024

Fixes spinnaker/spinnaker#6922.

Ultimately, considers the WWW-Authenticate header value as a List<String> as opposed to casting it directly to a String.

According to Mozilla's WWW-Authenticate header documentation, it is possible for the server to respond with multiple challenges through multiple header values. As such, I decided not to simply fetch the first header value, but now loop over the values and handle the first to match the bearer or basic prefix. It might be time to extract this to a separate method, but I kept the diff as small as possible.

I am not too familiar with Groovy nor Spock, so feel free to apply improvements where you deem fit.

The first commit serves as a regression test that the second commit fixes.


This is an automatic backport of pull request #6139 done by [Mergify](https://mergify.com).

…ate` header (#6139)

* test(provider/docker): Add test for `WWW-Authenticate` header parsing

* fix(provider/docker): Support multiple challenges from `WWW-Authenticate` header

(cherry picked from commit 2aeea5a)
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for a merge label Mar 27, 2024
@mergify mergify bot added the auto merged Merged automatically by a bot label Mar 27, 2024
@mergify mergify bot merged commit 54856aa into release-1.33.x Mar 27, 2024
17 checks passed
@mergify mergify bot deleted the mergify/bp/release-1.33.x/pr-6139 branch March 27, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for a merge target-release/1.33
Projects
None yet
3 participants