[CORE-13202] config: introduce sasl mechanisms override#27458
[CORE-13202] config: introduce sasl mechanisms override#27458IoannisRP merged 2 commits intoredpanda-data:devfrom
Conversation
c23baa3 to
826d0c2
Compare
src/v/config/configuration.cc
Outdated
| "sasl_mechanisms_overrides", | ||
| "A list of sasl mechanisms overrides, defined by listener. Same " | ||
| "limitations " | ||
| "apply as in `sasl_mechanisms`.", |
There was a problem hiding this comment.
| "apply as in `sasl_mechanisms`.", | |
| "apply as for `sasl_mechanisms`.", |
Should this also mention enterprise_sasl_mechanism?
There was a problem hiding this comment.
Should this also mention enterprise_sasl_mechanism?
We don't even describe what is an enterprise value for the sasl_mechanisms 😅
Probably something to deal with in a follow up pr
asimms41
left a comment
There was a problem hiding this comment.
Just a few suggestions.
CI test resultstest results on build#71775
test results on build#71804
test results on build#71893
test results on build#72162
test results on build#72245
|
826d0c2 to
6aa412a
Compare
|
Changes in force-push:
|
Retry command for Build#71804please wait until all jobs are finished before running the slash command |
michael-redpanda
left a comment
There was a problem hiding this comment.
Nice!
Can we maybe expand that PLAIN test to validate that if PLAIN is in the global list but not in the overrides that client attempting to connect via PLAIN fails?
src/v/config/sasl_mechanisms.h
Outdated
| inline constexpr auto enterprise_sasl_mechanisms | ||
| = std::to_array<std::string_view>({gssapi, oauthbearer}); | ||
|
|
||
| bool enterprise_sasl_mechanism(const ss::sstring& sasl_mech); |
There was a problem hiding this comment.
two nits:
- docs
- maybe should be
is_enterprise_sasl_mechanism
| bool enterprise_sasl_mechanism(const ss::sstring& sasl_mech); | ||
|
|
||
| // Checks if `sasl_mech` is enabled in sasl_mechanisms config | ||
| bool has_sasl_mechanism(const std::string_view sasl_mech); |
There was a problem hiding this comment.
suggestion: to make this easier to use in tests, maybe also supply a reference to the config store you wish to check against rather than always using config::shard_local_cfg()
There was a problem hiding this comment.
config_store deals in base_property which doesn't know anything about the concrete types of the property values. We would have to serialize the property (which is the only way to inspect a property value through a base_property) and do string manipulations to see if sasl_mech exists or not in it.
6aa412a to
f8a75db
Compare
|
changes in force-push:
|
| bool is_enterprise_sasl_mechanism(const ss::sstring& sasl_mech); | ||
|
|
||
| // Checks if `sasl_mech` is enabled in sasl_mechanisms config | ||
| bool has_sasl_mechanism(const std::string_view sasl_mech); |
There was a problem hiding this comment.
why const? string_view is already intended to be read-only.
There was a problem hiding this comment.
same difference between a const ptr* and const ptr* const.
It is not about the underlying data that the string_view is pointing at. It is about the string_view itself.
I am a big fan of "const-everything", in general, even when it doesn't make a significant (any?) difference.
Following the same logic, i tend to prefer void foo(const int) over void foo(int) (assuming the value doesn't change during the function execution).
| const auto overrides = config::shard_local_cfg().sasl_mechanisms_overrides() | ||
| | std::views::transform( | ||
| &sasl_mechanisms_override::sasl_mechanisms); |
There was a problem hiding this comment.
Do we need to check here if a particular listener exists at all? I think it's fine not to, but wondering if others have an opinion here.
f8a75db to
014229b
Compare
014229b to
9ed3043
Compare
|
changes in force-push
changes in force-push:
|
This new config is a way to control the cluster's sasls_mechanisms on a per-listener basis. For a given kafka listener, if there is an entry in the sasl_mechanisms_overrides config, the value from sasl_mechanisms will be ignored and the override will be used in its place. For any functionality that needs to know if a sasl mechanisms is active, like for the enterprise features check, it is considered active if it is used in any listener override.
9ed3043 to
5a79084
Compare
|
changes in force-push:
|
implements: CORE-13202
Backports Required
Release Notes
Features