-
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
fix: ksql.service.id should not be usable as a query parameter #7192
fix: ksql.service.id should not be usable as a query parameter #7192
Conversation
@confluentinc It looks like @tolgadur just signed our Contributor License Agreement. 👍 Always at your service, clabot |
@@ -618,6 +618,7 @@ public static KsqlRestApplication buildApplication(final KsqlRestConfig restConf | |||
final String ksqlServerId = ksqlConfig.getString(KsqlConfig.KSQL_SERVICE_ID_CONFIG); | |||
updatedRestProps.putAll( | |||
MetricCollectors.addConfluentMetricsContextConfigs(ksqlServerId, kafkaClusterId)); | |||
updatedRestProps.put(KsqlConfig.KSQL_PROPERTIES_OVERRIDES_DENYLIST, "ksql.service.id"); |
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.
if this was already specified, wouldn't this overwrite the previous value?
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.
Yes, you are right 😅. I changed it.
2c612e3
to
40023c2
Compare
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 for patching a long-standing bug!
this.immutableProps = ImmutableSet.copyOf( | ||
Objects.requireNonNull(immutableProps, "immutableProps")); | ||
this.immutableProps = ImmutableSet.<String>builder().addAll( | ||
Objects.requireNonNull(immutableProps, "immutableProps")).add("ksql.service.id").build(); |
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 think you should be able to specify KsqlConfig.KSQL_SERVICE_ID_CONFIG
here instead of hardcoding the property
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, could you also add a unit test in DenyListPropertyValidatorTest.java?
40023c2
to
60a5cc3
Compare
60a5cc3
to
7dc5b9d
Compare
Issue: #6869
ksql.service.id was settable as a query-level parameter but it should only be settable as a server-level parameter.
Description
The query-parameters that aren't allowed to be set are defined in the denylist that is imported from the ksql-server.properties. I hardcoded the 'ksql.servier.id' in the denylist as I wasn't sure if I should edit the config files. Hence, alternative to my approach we could edit the config files from where the denylist is imported.
Testing done
Just made sure that all tests run as there were already tests checking whether the properties set in the denylist actually are actually denied from query-level parameter setting.
Reviewer checklist