-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: add config for enabling topic access validator #3079
feat: add config for enabling topic access validator #3079
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thanks @rodesai !
KSQL_ACCESS_VALIDATOR_AUTO | ||
), | ||
ConfigDef.Importance.LOW, | ||
"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a doc for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree on the doc +1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want this to be an internal config for now. I thought that the way you do that was with an empty docstring, but you actually have to call defineInternal. But then you can't specify a validator. I'm going to choose to not define this as an internal config, so I'll add a doc string. This only matters once we start using auto-doc-generation. And even then, there isn't really any harm in exposing the config, other than adding noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch looks good. Just the minor two comments I left.
) { | ||
final String enabled = ksqlConfig.getString(KsqlConfig.KSQL_ENABLE_TOPIC_ACCESS_VALIDATOR); | ||
if (enabled.equals(KsqlConfig.KSQL_ACCESS_VALIDATOR_ON)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional:
Is case-sensitive a requirement in all KSQL configurations? Should we allow the use of any case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other similar config (ksql.named.internal.topics
) is case-sensitive. I don't feel particularly strongly one way or another.
KSQL_ACCESS_VALIDATOR_AUTO | ||
), | ||
ConfigDef.Importance.LOW, | ||
"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree on the doc +1
Adds a config called ksql.access.validator.enable for enabling the topic access validator. The possible values for this config are "on", "off", and "auto". "on" is used to enable the validator, "off" is used to disable it, and "auto" can be set to have ksql query kafka properties to auto-discover whether or not the validator can be used ( this is the behaviour before this patch, and is the current default value for this setting). This config is useful for enabling the validator when using ksql against multi-tenant kafka, where ksql will not have access to the broker's configs. This patch also switches the topic validator factory test to use mockito for mocking, instead of easymock.
a71f587
to
31d29c1
Compare
Adds a config called ksql.access.validator.enable for enabling the
topic access validator. The possible values for this config are "on",
"off", and "auto". "on" is used to enable the validator, "off"
is used to disable it, and "auto" can be set to have ksql query kafka
properties to auto-discover whether or not the validator can be used (
this is the behaviour before this patch, and is the current default
value for this setting). This config is useful for enabling the validator
when using ksql against multi-tenant kafka, where ksql will not have
access to the broker's configs.
This patch also switches the topic validator factory test to use mockito
for mocking, instead of easymock.