mirror of https://github.com/apache/kafka.git
KAFKA-18813: [3/N] Client support for TopicAuthException in DescribeConsumerGroup path (#18996)
Reviewers: David Jacot <djacot@confluent.io>
This commit is contained in:
parent
8383c88a70
commit
364479cf24
|
|
@ -331,7 +331,9 @@ public class DescribeConsumerGroupsHandler implements AdminApiHandler<Coordinato
|
||||||
|
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case GROUP_AUTHORIZATION_FAILED:
|
case GROUP_AUTHORIZATION_FAILED:
|
||||||
|
case TOPIC_AUTHORIZATION_FAILED:
|
||||||
log.debug("`{}` request for group id {} failed due to error {}.", apiName, groupId.idValue, error);
|
log.debug("`{}` request for group id {} failed due to error {}.", apiName, groupId.idValue, error);
|
||||||
|
// The topic auth response received on DescribeConsumerGroup is a generic one not including topic names, so we just pass it on unchanged here.
|
||||||
failed.put(groupId, error.exception(errorMsg));
|
failed.put(groupId, error.exception(errorMsg));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import org.apache.kafka.common.Uuid;
|
||||||
import org.apache.kafka.common.errors.GroupAuthorizationException;
|
import org.apache.kafka.common.errors.GroupAuthorizationException;
|
||||||
import org.apache.kafka.common.errors.GroupIdNotFoundException;
|
import org.apache.kafka.common.errors.GroupIdNotFoundException;
|
||||||
import org.apache.kafka.common.errors.InvalidGroupIdException;
|
import org.apache.kafka.common.errors.InvalidGroupIdException;
|
||||||
|
import org.apache.kafka.common.errors.TopicAuthorizationException;
|
||||||
import org.apache.kafka.common.errors.UnsupportedVersionException;
|
import org.apache.kafka.common.errors.UnsupportedVersionException;
|
||||||
import org.apache.kafka.common.message.ConsumerGroupDescribeRequestData;
|
import org.apache.kafka.common.message.ConsumerGroupDescribeRequestData;
|
||||||
import org.apache.kafka.common.message.ConsumerGroupDescribeResponseData;
|
import org.apache.kafka.common.message.ConsumerGroupDescribeResponseData;
|
||||||
|
|
@ -321,6 +322,7 @@ public class DescribeConsumerGroupsHandlerTest {
|
||||||
@Test
|
@Test
|
||||||
public void testFailedHandleConsumerGroupResponse() {
|
public void testFailedHandleConsumerGroupResponse() {
|
||||||
assertFailed(GroupAuthorizationException.class, handleConsumerGroupWithError(Errors.GROUP_AUTHORIZATION_FAILED));
|
assertFailed(GroupAuthorizationException.class, handleConsumerGroupWithError(Errors.GROUP_AUTHORIZATION_FAILED));
|
||||||
|
assertFailed(TopicAuthorizationException.class, handleConsumerGroupWithError(Errors.TOPIC_AUTHORIZATION_FAILED));
|
||||||
assertFailed(InvalidGroupIdException.class, handleConsumerGroupWithError(Errors.INVALID_GROUP_ID));
|
assertFailed(InvalidGroupIdException.class, handleConsumerGroupWithError(Errors.INVALID_GROUP_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue