DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
Status
Current state: Under Discussion
Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]
JIRA:
KAFKA-18926
-
Getting issue details...
STATUS
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
Before KRaft, custom KafkaPrincipalBuilder implementations only needed to build principals. However, KRaft requires brokers to forward requests involving these principals to controllers. Without corresponding KafkaPrincipalSerde implementations, brokers cannot serialize/deserialize them, causing failures. Currently, the API doesn't enforce the implementation of KafkaPrincipalSerde alongside KafkaPrincipalBuilder. This KIP aims to rectify this by making it a compile-time requirement.
Public Interfaces
org.apache.kafka.common.security.auth.KafkaPrincipalBuilder
public interface KafkaPrincipalBuilder {
KafkaPrincipal build(AuthenticationContext context);
}
Proposed Changes
The proposed change is to modify the KafkaPrincipalBuilder interface to extend the KafkaPrincipalSerde interface. The updated interface definition will be:
public interface KafkaPrincipalBuilder extends KafkaPrincipalSerde {
KafkaPrincipal build(AuthenticationContext context);
}
This change will introduce a compile-time error for any existing KafkaPrincipalBuilder implementation that does not also implement KafkaPrincipalSerde.
Compatibility, Deprecation, and Migration Plan
This is a change to a public API, and therefore has the potential to break existing code. However, the risk is considered acceptable because existing custom KafkaPrincipalBuilder implementations that are already implemented KafkaPrincipalSerde.
Thus this change is proposed for a minor or feature release (specifically, 4.1 as suggested), allowing users sufficient time to adapt the change.
Test Plan
Given that existing KafkaPrincipalBuilder implementations used with KRaft already implement KafkaPrincipalSerde, this change should not result in new compile-time errors, and existing test cases are expected to pass.
Rejected Alternatives
N/A