Skip to content

Conversation

@mimaison
Copy link
Member

@mimaison mimaison commented Oct 22, 2025

Implements KIP-1188

@mimaison mimaison marked this pull request as ready for review October 24, 2025 09:48
@mimaison
Copy link
Member Author

cc @C0urante @AndrewJSchofield @showuon as you voted on the KIP. Thanks

Copy link
Contributor

@C0urante C0urante left a 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

Copy link
Member

@AndrewJSchofield AndrewJSchofield left a 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. "
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Missing "." before "Note"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

@C0urante C0urante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mimaison mimaison merged commit a395d06 into apache:trunk Oct 28, 2025
23 of 24 checks passed
@mimaison mimaison deleted the kafka-19824 branch October 28, 2025 08:19
* @deprecated Use {@link AllowlistConnectorClientConfigOverridePolicy} instead.
*/
@Deprecated(since = " 4.2", forRemoval = true)
public class PrincipalConnectorClientConfigOverridePolicy extends AbstractConnectorClientConfigOverridePolicy {
Copy link
Member

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?

Copy link
Member Author

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);
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants