apache / apache/rocketmq

[Bug] Proxy ACL metadata providers return null futures for unsupported mutations

Open
#10,709 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

Description

### Before Creating the Bug Report

- [x] I found a bug, not just asking a question, which should be created in GitHub Issues.
- [x] I have searched the existing issues and believe this is not a duplicate.
- [x] I have confirmed that this bug belongs to the current repository.

### Describe the Bug

`ProxyAuthenticationMetadataProvider` and `ProxyAuthorizationMetadataProvider` implement async metadata provider interfaces, but several unsupported methods currently return `null` instead of a `CompletableFuture`.

Examples:

- `ProxyAuthenticationMetadataProvider#createUser`
- `ProxyAuthenticationMetadataProvider#deleteUser`
- `ProxyAuthenticationMetadataProvider#updateUser`
- `ProxyAuthenticationMetadataProvider#listUser`
- `ProxyAuthorizationMetadataProvider#createAcl`
- `ProxyAuthorizationMetadataProvider#deleteAcl`
- `ProxyAuthorizationMetadataProvider#updateAcl`
- `ProxyAuthorizationMetadataProvider#listAcl`

Returning `null` from an async provider is unsafe because callers naturally treat these methods as returning a `CompletableFuture`. That can turn an unsupported operation into a `NullPointerException`, hiding the real capability gap and making Proxy ACL diagnostics harder.

### Expected Behavior

Unsupported mutation/list operations should never return `null`. They should either:

1. delegate to the underlying metadata service if the operation is supported; or
2. return a failed `CompletableFuture` with a clear `UnsupportedOperationException` / diagnostic message.

The existing read paths (`getUser`, `getAcl`) should keep their current behavior.

### Scope

RocketMQ Studio Track 2 / Proxy Admin authentication and authorization foundation. This also improves the AUTH-01 call-chain behavior expected by Control Plane integrations.

### Proposed Fix

Return failed futures for currently unsupported operations, with method-specific messages. Add unit tests to assert every unsupported method returns a non-null future that completes exceptionally instead of returning `null`.

Contributor guide

Open the contributing guide

Research direction

Start by locating ProxyAuthenticationMetadataProvider and ProxyAuthorizationMetadataProvider and read the implementations of the listed unsupported methods, then find their unit tests or add tests alongside them. Verify each method returns a non-null CompletableFuture that completes exceptionally with a method-specific unsupported-operation diagnostic, while getUser and getAcl retain their current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, authorization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.