AndrewJSchofield commented on code in PR #20750:
URL: https://github.com/apache/kafka/pull/20750#discussion_r2465330380
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfig.java:
##########
@@ -159,8 +160,9 @@ public class WorkerConfig extends AbstractConfig {
public static final String CONNECTOR_CLIENT_POLICY_CLASS_DOC =
"Class name or alias of implementation of
<code>ConnectorClientConfigOverridePolicy</code>. Defines what client
configurations can be "
+ "overridden by the connector. The default implementation is
<code>All</code>, meaning connector configurations can override all client
properties. "
Review Comment:
nit: "The default policy" reads a little better than "The default
implementation" given that the others are described as policies.
##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/AbstractHerderTest.java:
##########
@@ -788,6 +790,50 @@ public void testConfigValidationAllOverride() {
verifyValidationIsolation();
}
+ @Test
+ public void testConfigValidationAllowlistOverride() {
+ final Class<? extends Connector> connectorClass =
SampleSourceConnector.class;
+ AllowlistConnectorClientConfigOverridePolicy policy = new
AllowlistConnectorClientConfigOverridePolicy();
+
policy.configure(Map.of(AllowlistConnectorClientConfigOverridePolicy.ALLOWLIST_CONFIG,
"acks"));
+ AbstractHerder herder = createConfigValidationHerder(connectorClass,
policy);
+
+ Map<String, String> config = new HashMap<>();
+ config.put(ConnectorConfig.CONNECTOR_CLASS_CONFIG,
connectorClass.getName());
+ config.put(ConnectorConfig.NAME_CONFIG, "connector-name");
+ config.put("required", "value"); // connector required config
+ String ackConfigKey = producerOverrideKey(ProducerConfig.ACKS_CONFIG);
+ String saslConfigKey =
producerOverrideKey(SaslConfigs.SASL_JAAS_CONFIG);
+ config.put(ackConfigKey, "none");
+ config.put(saslConfigKey, "jaas_config");
+
+ ConfigInfos result = herder.validateConnectorConfig(config, s -> null,
false);
+ assertEquals(ConnectorType.SOURCE, herder.connectorType(config));
+
+ // We expect there to be errors due to sasl.jaas.config not being
allowed Note that these assertions depend heavily on
Review Comment:
nit: Missing "." before "Note"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]