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

fix: ksql.service.id should not be usable as a query parameter #7192

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ksqldb-cli/src/main/java/io/confluent/ksql/cli/Cli.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ private void setPropertyFromCtxt(

private void setProperty(final String property, final String value) {
final Object priorValue = restClient.setProperty(property, value);

terminal.writer().printf(
"Successfully changed local property '%s'%s to '%s'.%s%n",
property,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import io.confluent.ksql.util.KsqlConfig;
import io.confluent.ksql.util.KsqlException;

import java.util.Collection;
Expand All @@ -32,8 +33,8 @@ public class DenyListPropertyValidator {
private final Set<String> immutableProps;

public DenyListPropertyValidator(final Collection<String> immutableProps) {
this.immutableProps = ImmutableSet.copyOf(
Objects.requireNonNull(immutableProps, "immutableProps"));
this.immutableProps = ImmutableSet.<String>builder().addAll(
Objects.requireNonNull(immutableProps, "immutableProps")).add(KsqlConfig.KSQL_SERVICE_ID_CONFIG).build();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,21 @@ public void shouldNotThrowOnAllowedProp() {
"anything", "v2"
));
}

@Test
public void shouldThrowOnKsqlServiceIdProperty() {
// When:
final KsqlException e = assertThrows(
KsqlException.class,
() -> validator.validateAll(ImmutableMap.of(
"ksql.service.id", "v1"
))
);

// Then:
assertThat(e.getMessage(), containsString(
"One or more properties overrides set locally are prohibited by the KSQL server "
+ "(use UNSET to reset their default value): [ksql.service.id]"
));
}
}