apache / apache/rocketmq

[Bug] Bug title 无法删除 PolicyType为Default 的 acl

Open
#9,966 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
2d 20h
Merged PRs (30d)
26

Description

### Before Creating the Bug Report

- [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions).

- [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate.

- [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

### Runtime platform environment

macos

### RocketMQ version

5.3.4

### JDK Version

1.8

### Describe the Bug

dashboard 可以创建 PolicyType 为Default 类型的acl,但是 mqadmin 删除acl的时候 无法指定 PolicyType,再加上mqadmin 和 dashboard都不强制 源ip 地址,dashboard遇到ip为 null 现在有bug,最坏情况就是在dashboard 创建了 Default 类型,并且没设置ip地址的acl,之后dashboard ACL Permissions页面就彻底挂了

Image

### Steps to Reproduce

打开dashboard 创建 Default 类型的 acl

### What Did You Expect to See?

dashboard 是否应该禁止创建 Default 类型的 acl,或者 mqadmin 支持删除 Default 类型的acl

### What Did You See Instead?

无法删除 PolicyType为Default 的 acl

### Additional Context

创建 requestHeader 的时候就没传递 PolicyType
https://github.com/apache/rocketmq/blob/rocketmq-all-5.3.4/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java#L3552

当前没有设置 policyType 的时候 设置的是 CUSTOM
https://github.com/apache/rocketmq/blob/rocketmq-all-5.3.4/auth/src/main/java/org/apache/rocketmq/auth/authorization/manager/AuthorizationMetadataManagerImpl.java#L141

Contributor guide

Open the contributing guide

Research direction

Read client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java around line 3552 and auth/src/main/java/org/apache/rocketmq/auth/authorization/manager/AuthorizationMetadataManagerImpl.java around line 141. Reproduce creating a Default ACL in the dashboard, then trace the mqadmin deletion path and the dashboard Permissions page with a null source IP. Done should establish and implement consistent handling for Default policy ACLs, including deletion or creation validation, without leaving the page unusable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authorization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.