[fix][broker] Authorize cluster listing requests - #26267
Open
ChimdumebiNebolisa wants to merge 2 commits into
Open
[fix][broker] Authorize cluster listing requests#26267ChimdumebiNebolisa wants to merge 2 commits into
ChimdumebiNebolisa wants to merge 2 commits into
Conversation
nodece
approved these changes
Aug 5, 2026
Contributor
|
Thanks for the fix. I have a few questions/comments:
I'm not against this change; I'd just like to better understand the motivation and whether a compatibility option has been considered. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #26100
Motivation
GET /admin/v2/clustersreturned cluster names without invoking the cluster authorization path. Authenticated users without the global cluster-list permission could therefore enumerate clusters.Modifications
Authorize cluster listing with
ClusterOperation.LIST_CLUSTERSusing the establishednullglobal-resource scope before reading cluster metadata. Added endpoint-level coverage for authorized and denied requests, including verification of the authorization operation and scope.This is intentionally a v5/master-only behavior change: third-party
AuthorizationProviderimplementations must support this cluster operation and globalnullscope for non-superuser requests.Verifying this change
This change added tests and can be verified as follows:
gradlew.bat --no-daemon --rerun-tasks :pulsar-broker:test -PtestRetryCount=0 --tests org.apache.pulsar.broker.admin.ClusterEndpointsAuthorizationTestgradlew.bat --no-daemon --rerun-tasks :pulsar-broker:spotlessJavaCheck :pulsar-broker:checkstyleMain :pulsar-broker:checkstyleTestgit diff --checkDoes this pull request potentially affect one of the following parts: