Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/src/main/scala/kafka/server/KafkaApis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3824,6 +3824,7 @@ class KafkaApis(val requestChannel: RequestChannel,

def handleConsumerGroupDescribe(request: RequestChannel.Request): CompletableFuture[Unit] = {
val consumerGroupDescribeRequest = request.body[ConsumerGroupDescribeRequest]
val includeAuthorizedOperations = consumerGroupDescribeRequest.data.includeAuthorizedOperations

if (!config.isNewGroupCoordinatorEnabled) {
// The API is not supported by the "old" group coordinator (the default). If the
Expand Down Expand Up @@ -3852,6 +3853,17 @@ class KafkaApis(val requestChannel: RequestChannel,
if (exception != null) {
requestHelper.sendMaybeThrottle(request, consumerGroupDescribeRequest.getErrorResponse(exception))
} else {
if (request.header.apiVersion >= 3 && includeAuthorizedOperations) {
Comment thread
riedelmax marked this conversation as resolved.
Outdated
results.forEach { groupResult =>
if (groupResult.errorCode == Errors.NONE.code) {
groupResult.setAuthorizedOperations(authHelper.authorizedOperations(
request,
new Resource(ResourceType.GROUP, groupResult.groupId)
))
}
}
}

if (response.groups.isEmpty) {
// If the response is empty, we can directly reuse the results.
response.setGroups(results)
Expand Down