mirror of https://github.com/apache/kafka.git
KAFKA-14236; ListGroups request produces too much Denied logs in authorizer (#12652)
Avoid `is Denied Operation` logs when calling ListGroups api, by adding `logIfDenied = false` to `authorize` calls. Reviewers: Jason Gustafson <jason@confluent.io>
This commit is contained in:
parent
695424fa9d
commit
cb9557a990
|
|
@ -1635,12 +1635,12 @@ class KafkaApis(val requestChannel: RequestChannel,
|
|||
)
|
||||
}
|
||||
val (error, groups) = groupCoordinator.handleListGroups(states)
|
||||
if (authHelper.authorize(request.context, DESCRIBE, CLUSTER, CLUSTER_NAME))
|
||||
if (authHelper.authorize(request.context, DESCRIBE, CLUSTER, CLUSTER_NAME, logIfDenied = false))
|
||||
// With describe cluster access all groups are returned. We keep this alternative for backward compatibility.
|
||||
requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
|
||||
createResponse(requestThrottleMs, groups, error))
|
||||
else {
|
||||
val filteredGroups = groups.filter(group => authHelper.authorize(request.context, DESCRIBE, GROUP, group.groupId))
|
||||
val filteredGroups = groups.filter(group => authHelper.authorize(request.context, DESCRIBE, GROUP, group.groupId, logIfDenied = false))
|
||||
requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
|
||||
createResponse(requestThrottleMs, filteredGroups, error))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue