-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix incorrect AuthData passed to AuthorizationService in proxy scenarios #24593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
codelipenghui
merged 5 commits into
apache:master
from
codelipenghui:fix-server-cnx-test-authorization-signatures
Jul 31, 2025
Merged
[fix][broker] Fix incorrect AuthData passed to AuthorizationService in proxy scenarios #24593
codelipenghui
merged 5 commits into
apache:master
from
codelipenghui:fix-server-cnx-test-authorization-signatures
Jul 31, 2025
Conversation
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
…thod signature changes Fixed failing tests in ServerCnxTest.java caused by changes to the AuthorizationService.allowTopicOperationAsync method signature. The new 6-parameter method separates originalAuthData and authData parameters. Changes: - Updated test mocks from 5 to 6 parameters in authorization test methods - Fixed verification calls to match new method signature - Updated testProducerCommandWithAuthorizationNegative - Updated testSubscribeCommandWithAuthorizationPositive/Negative - Fixed testVerifyOriginalPrincipalWithAuthDataForwardedFromProxy All 109 tests in ServerCnxTest now pass successfully. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
/pulsarbot run-failure-checks |
PR apache#24533 introduced incorrect AuthData handling in proxy scenarios, where the AuthorizationService.allowTopicOperationAsync method was being called with wrong parameters, losing the separation between proxy auth data and original client auth data. This fix: - Adds a new 6-parameter allowTopicOperationAsync method that properly separates originalAuthData and authData validation - Updates ServerCnx to use the new method with correct parameters - Fixes authorization logic to validate both proxy and original client permissions independently - Updates all affected test verification calls to match new method signatures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Technoboy-
approved these changes
Jul 31, 2025
Updates testVerifyOriginalPrincipalWithoutAuthDataForwardedFromProxy verification calls to use the correct 6-parameter allowTopicOperationAsync method signature and match the actual AuthenticationDataCommand objects being passed instead of expecting null values. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24593 +/- ##
============================================
+ Coverage 73.57% 74.31% +0.74%
- Complexity 32624 32676 +52
============================================
Files 1877 1880 +3
Lines 139502 146430 +6928
Branches 15299 16788 +1489
============================================
+ Hits 102638 108822 +6184
- Misses 28908 28965 +57
- Partials 7956 8643 +687
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
gaozhangmin
pushed a commit
to gaozhangmin/pulsar
that referenced
this pull request
Aug 13, 2025
…n proxy scenarios (apache#24593)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
Aug 14, 2025
…n proxy scenarios (apache#24593)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Aug 20, 2025
…n proxy scenarios (apache#24593) (cherry picked from commit 82a3203) (cherry picked from commit 247913e)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Aug 26, 2025
…n proxy scenarios (apache#24593) (cherry picked from commit 82a3203) (cherry picked from commit 247913e)
KannarFr
pushed a commit
to CleverCloud/pulsar
that referenced
this pull request
Sep 22, 2025
…n proxy scenarios (apache#24593)
walkinggo
pushed a commit
to walkinggo/pulsar
that referenced
this pull request
Oct 8, 2025
…n proxy scenarios (apache#24593)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-4.0
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/4.0.6
type/bug
The PR fixed a bug or issue reported a bug
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.
Summary
Fixes an issue introduced by PR #24533 where incorrect AuthData was being passed to the AuthorizationService in proxy scenarios.
Problem
PR #24533 changed the
ServerCnx.isTopicOperationAllowed()method to call:https://github.com/apache/pulsar/pull/24533/files#diff-1e0e8195fb5ec5a6d79acbc7d859c025a9b711f94e6ab37c94439e99b3202e84R480-R483
This might breaks proxy authorization scenarios for some customized implementation of AuthorizationProvider where both the proxy's auth data (
authDataSource) and the original client's auth data (originalAuthDataSource) need to be validated separately.Root Cause
The old 5-parameter method signature was limiting and caused incorrect authorization decisions in proxy scenarios. The fix uses the new 6-parameter method that properly separates the two auth data sources.
Solution
AuthorizationService Changes
allowTopicOperationAsyncmethod that takes bothoriginalAuthDataandauthDataseparatelyisProxyRole(role)is trueServerCnx Changes
Test Updates
Impact
Before (Broken):
After (Fixed):
Test Results
✅ All 109 tests in ServerCnxTest pass
✅ Authorization logic works correctly for:
References
Documentation
docdoc-requireddoc-not-neededdoc-complete