Dear Kafka Community, I am reaching out for guidance on how to retrieve the current user who is attempting to create a topic within the CreateTopicPolicy implementation in Apache Kafka. Our goal is to restrict topic creation based on a configured maximum limit for each user.
While working on implementing the topic creation restriction based on a user-specific configured maximum limit, I found that the CreateTopicPolicy interface provides limited data through the RequestMetadata object, including parameters like numPartitions and replicationFactor. However, it does not straightforwardly provide the username or user-specific information required for policy enforcement. Our objective is to identify the current user creating the topic within the CreateTopicPolicy and use this information to enforce topic creation restrictions based on the maximum configured limit for each user. I have developed a solution in a Java application using Kafka APIs to retrieve user-specific information for this purpose. Now, I am seeking advice on how to integrate this logic within Kafka, specifically within the CreateTopicPolicy context. If anyone has insights on how to access the current user information effectively within the CreateTopicPolicy for topic creation restriction based on a configured maximum limit, your guidance and expertise would be highly appreciated. Thank you in advance for your support and assistance Best Regards, Ravi Yadav Thoughtworks Technologies