Skip to content

Commit 1f387b2

Browse files
Fix ACL 2.0: correct consumer group extraction from retry topic in SEND_MESSAGE/SEND_MESSAGE_V2/SEND_BATCH_MESSAGE (#9911)
1 parent 89e021e commit 1f387b2

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

auth/src/main/java/org/apache/rocketmq/auth/authorization/builder/DefaultAuthorizationContextBuilder.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,7 @@ public List<DefaultAuthorizationContext> build(ChannelHandlerContext context, Re
192192
break;
193193
case RequestCode.SEND_MESSAGE:
194194
if (NamespaceUtil.isRetryTopic(fields.get(TOPIC))) {
195-
if (StringUtils.isNotBlank(fields.get(GROUP))) {
196-
group = Resource.ofGroup(fields.get(GROUP));
197-
} else {
198-
group = Resource.ofGroup(fields.get(TOPIC));
199-
}
195+
group = Resource.ofGroup(fields.get(TOPIC));
200196
result.add(DefaultAuthorizationContext.of(subject, group, Action.SUB, sourceIp));
201197
} else {
202198
topic = Resource.ofTopic(fields.get(TOPIC));
@@ -206,11 +202,7 @@ public List<DefaultAuthorizationContext> build(ChannelHandlerContext context, Re
206202
case RequestCode.SEND_MESSAGE_V2:
207203
case RequestCode.SEND_BATCH_MESSAGE:
208204
if (NamespaceUtil.isRetryTopic(fields.get(B))) {
209-
if (StringUtils.isNotBlank(fields.get(A))) {
210-
group = Resource.ofGroup(fields.get(A));
211-
} else {
212-
group = Resource.ofGroup(fields.get(B));
213-
}
205+
group = Resource.ofGroup(fields.get(B));
214206
result.add(DefaultAuthorizationContext.of(subject, group, Action.SUB, sourceIp));
215207
} else {
216208
topic = Resource.ofTopic(fields.get(B));

0 commit comments

Comments
 (0)