Skip to content
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

KAFKA-10212: Describing a topic with the TopicCommand fails if unauthorised to use ListPartitionReassignments API #8947

Closed
wants to merge 3 commits into from

Conversation

dajac
Copy link
Contributor

@dajac dajac commented Jun 29, 2020

Since https://issues.apache.org/jira/browse/KAFKA-8834, describing topics with the TopicCommand requires privileges to use ListPartitionReassignments or fails to describe the topics with the following error:

Error while executing topic command : Cluster authorization failed.

This is a quite hard restriction has most of the secure clusters do not authorize non admin members to access ListPartitionReassignments.

This patch catches the ClusterAuthorizationException exception and gracefully fails back. We already do this when the API is not available so it remains consistent.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

…orised to use ListPartitionReassignments API
@omkreddy
Copy link
Contributor

ok to test

@rhauch rhauch changed the title KAFKA-10212; Describing a topic with the TopicCommand fails if unauthorised to use ListPartitionReassignments API KAFKA-10212: Describing a topic with the TopicCommand fails if unauthorised to use ListPartitionReassignments API Jun 29, 2020
Copy link
Contributor

@omkreddy omkreddy left a comment

Choose a reason for hiding this comment

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

@dajac Thanks for the PR. LGTM. Will merge after tests status.

looks like PR has conflicts with 2.5 branch. Can you please raise separate PR for 2.5 branch?

@omkreddy
Copy link
Contributor

retest this please

@dajac
Copy link
Contributor Author

dajac commented Jun 29, 2020

@omkreddy I have opened #8951 for 2.5.

@omkreddy
Copy link
Contributor

@dajac We have ambiguous reference error for scala 2.12

21:45:50 > Task :core:compileTestScala
21:45:50 [Error] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk8-scala2.12/core/src/test/scala/unit/kafka/admin/TopicCommandWithAdminClientTest.scala:815: ambiguous reference to overloaded definition,
21:45:50 both method doReturn in class Mockito of type (x$1: Any, x$2: Object*)org.mockito.stubbing.Stubber
21:45:50 and  method doReturn in class Mockito of type (x$1: Any)org.mockito.stubbing.Stubber
21:45:50 match argument types (org.apache.kafka.clients.admin.ListPartitionReassignmentsResult)

@dajac
Copy link
Contributor Author

dajac commented Jun 29, 2020

@omkreddy I just pushed a fix.

@omkreddy
Copy link
Contributor

retest this please

@omkreddy
Copy link
Contributor

ok to test

@omkreddy omkreddy closed this in 4be4420 Jun 30, 2020
omkreddy pushed a commit that referenced this pull request Jun 30, 2020
…orised to use ListPartitionReassignments API

Since https://issues.apache.org/jira/browse/KAFKA-8834, describing topics with the TopicCommand requires privileges to use ListPartitionReassignments or fails to describe the topics with the following error:

> Error while executing topic command : Cluster authorization failed.

This is a quite hard restriction has most of the secure clusters do not authorize non admin members to access ListPartitionReassignments.

This patch catches the `ClusterAuthorizationException` exception and gracefully fails back. We already do this when the API is not available so it remains consistent.

Author: David Jacot <djacot@confluent.io>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #8947 from dajac/KAFKA-10212

(cherry picked from commit 4be4420)
Signed-off-by: Manikumar Reddy <mkumar@xtreems.local>
@dajac dajac deleted the KAFKA-10212 branch October 6, 2020 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants