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

Add validation for sasl.username and sasl.password #472

Closed
tmgstevens opened this issue Jun 12, 2023 · 2 comments
Closed

Add validation for sasl.username and sasl.password #472

tmgstevens opened this issue Jun 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@tmgstevens
Copy link

Compared to librdkafka, franz-go does not appear to validate whether sasl.username and sasl.password are set to valid values.

Ideally the client should prevent empty values being set and sent to the server (noting also that Redpanda does not handle empty values well either)

@twmb twmb added the enhancement New feature or request label Jun 27, 2023
@twmb
Copy link
Owner

twmb commented Jun 27, 2023

This requires adding an optional Validate() error method and then implementing it on all SASL implementations. This is small, but will wait for v1.14.

@twmb twmb mentioned this issue Jun 30, 2023
17 tasks
@twmb
Copy link
Owner

twmb commented Jul 7, 2023

Actually, with how the interfaces are defined, it's a bit challenging to validate up front. I can add non-empty validation before the client first message is sent to the server -- this will bubble up as errors to the client in failed requests, but will not fail NewClient.

twmb added a commit that referenced this issue Jul 7, 2023
This avoids sending empty credentials to the user. It is difficult to
validate this up front because all mechanisms are designed for
hot-reloading credentials, but we can validate at the time just before
we connect and issue a request.

Closes #472.
@twmb twmb closed this as completed in b5cafba Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants