chia7712 commented on code in PR #24419:
URL: https://github.com/apache/kafka/pull/24419#discussion_r4733247968
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -798,10 +798,15 @@ class KafkaApis(val requestChannel: RequestChannel,
.setOffset(ListOffsetsResponse.UNKNOWN_OFFSET)
}
- val partitionResult = authHelper.partitionByAuthorized(request.context,
- DESCRIBE, TOPIC, offsetRequest.topics, (t:
ListOffsetsRequestData.ListOffsetsTopic) => t.name)
- val authorizedRequestInfo = partitionResult.authorized.asScala
- val unauthorizedRequestInfo = partitionResult.unauthorized.asScala
+ val (authorizedRequestInfo, unauthorizedRequestInfo) =
+ if (offsetRequest.replicaId != ListOffsetsRequest.CONSUMER_REPLICA_ID &&
+ !authHelper.authorize(request.context, CLUSTER_ACTION, CLUSTER,
CLUSTER_NAME)) {
+ (Seq.empty[ListOffsetsRequestData.ListOffsetsTopic],
offsetRequest.topics.asScala.toSeq)
+ } else {
+ val partitionResult = authHelper.partitionByAuthorized(request.context,
+ DESCRIBE, TOPIC, offsetRequest.topics, (t:
ListOffsetsRequestData.ListOffsetsTopic) => t.name)
Review Comment:
I'm wondering if we can skip the topic `DESCRIBE` check for replica
requests? They already have `CLUSTER_ACTION` at this point, and that is aligned
with the logic of `FETCH`. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]