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

pandaproxy: Support SCRAM-SHA-512 for basic_auth #11425

Merged

Conversation

BenPope
Copy link
Member

@BenPope BenPope commented Jun 14, 2023

User credentials provided by basic auth cannot provide a sasl_mechanism.

During request authorization, both mechanisms are tried, but the mechanism that succeeds was not propagated in the request_auth_result.

This commit propagates the successful mechanism and uses that during the creation of the client when http basic auth is used for requests to Pandaproxy, instead of hardcoding it to SCRAM-SHA-256.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v22.3.x
  • v22.2.x

Release Notes

Bug Fixes

  • pandaproxy: Support users with SCRAM-SHA-512 for authentication: http_basic.

User credentials provided by basic auth cannot provide a sasl_mechanism.

During request authorization, both mechanisms are tried, but the
mechanism that succeeds was not propagated in the request_auth_result.

This commit propagates the successful mechanism and uses that during
the creation of the client when http basic auth is used for requests
to Pandaproxy, instead of hardcoding it to SCRAM-SHA-256.

Signed-off-by: Ben Pope <ben@redpanda.com>
@BenPope BenPope added the area/pandaproxy REST interface for Kafka API label Jun 14, 2023
@BenPope BenPope requested a review from NyaliaLui June 14, 2023 11:04
@BenPope BenPope self-assigned this Jun 14, 2023
Copy link
Contributor

@alejandroEsc alejandroEsc left a comment

Choose a reason for hiding this comment

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

lgtm, but im not a c expert.

@piyushredpanda piyushredpanda merged commit d025608 into redpanda-data:dev Jun 14, 2023
18 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v23.1.x

@vbotbuildovich
Copy link
Collaborator

/backport v22.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v22.2.x

@vbotbuildovich
Copy link
Collaborator

Failed to run cherry-pick command. I executed the commands below:

git checkout -b backport-pr-11425-v22.2.x-42 remotes/upstream/v22.2.x
git cherry-pick -x 9fc1bcb7b4ec14f43f5f6a85760c6e2d9e1fadf0

Workflow run logs.

RafalKorepta pushed a commit to RafalKorepta/helm-charts-1 that referenced this pull request Jun 15, 2023
The PR redpanda-data#544 does not pass
tests due to bug in Redpanda. The pandaproxy fix will be backported eventually
redpanda-data/redpanda#11425, but to unblock the
nightly build the test SASL mechanism should be change from `SCRAM-SHA-512`
to `SCRAM-SHA-256`.
@Neustradamus
Copy link

@BenPope: Good job!

Linked to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants