-
Notifications
You must be signed in to change notification settings - Fork 14.8k
KAFKA-19824: New AllowlistConnectorClientConfigOverridePolicy (KIP-1188) #20750
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
Conversation
|
cc @C0urante @AndrewJSchofield @showuon as you voted on the KIP. Thanks |
C0urante
left a comment
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.
Thanks Mickael, only comment is about making the upgrade path clearer for users currently on the principal policy. Everything else looks good to me
.../org/apache/kafka/connect/connector/policy/PrincipalConnectorClientConfigOverridePolicy.java
Show resolved
Hide resolved
AndrewJSchofield
left a comment
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.
Thanks for the PR. A couple of nits only. Looks good to me.
| public static final String CONNECTOR_CLIENT_POLICY_CLASS_CONFIG = "connector.client.config.override.policy"; | ||
| 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. " |
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.
nit: "The default policy" reads a little better than "The default implementation" given that the others are described as policies.
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 agree, updated. Thanks
| 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 |
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.
nit: Missing "." before "Note"
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.
Fixed
C0urante
left a comment
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!
| * @deprecated Use {@link AllowlistConnectorClientConfigOverridePolicy} instead. | ||
| */ | ||
| @Deprecated(since = " 4.2", forRemoval = true) | ||
| public class PrincipalConnectorClientConfigOverridePolicy extends AbstractConnectorClientConfigOverridePolicy { |
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.
> Task :connect:runtime:compileTestJava
/home/chia7712/project/kafka/connect/runtime/src/test/java/org/apache/kafka/connect/connector/policy/PrincipalConnectorClientConfigOverridePolicyTest.java:30: warning: [removal] PrincipalConnectorClientConfigOverridePolicy in org.apache.kafka.connect.connector.policy has been deprecated and marked for removal
ConnectorClientConfigOverridePolicy principalConnectorClientConfigOverridePolicy = new PrincipalConnectorClientConfigOverridePolicy();
^
Note: /home/chia7712/project/kafka/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerSinkTaskTest.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
@mimaison Do you have time to open a minor PR to fix the warning?
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.
Good spot! I opened #20793
| private static final String ALLOWLIST_CONFIG_DOC = "List of client configurations that can be overridden by " + | ||
| "connectors. If empty, connectors can't override any client configurations."; | ||
| private static final ConfigDef CONFIG_DEF = new ConfigDef() | ||
| .define(ALLOWLIST_CONFIG, ConfigDef.Type.LIST, ALLOWLIST_CONFIG_DEFAULT, ConfigDef.Importance.MEDIUM, ALLOWLIST_CONFIG_DOC); |
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 check the duplicate items for this new configuration?
Implements KIP-1188