Skip to content
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

[fix][broker]Fixed produce and consume when anonymousUserRole enabled #21237

Conversation

tuteng
Copy link
Member

@tuteng tuteng commented Sep 23, 2023

My repo pr AmateurEvents#36

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

Implement the same logic as here https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L1010

When anonymousUserRole is enabled, pulsar-admin can successfully fetch cluster resources without authenticationProvider, but pulsar-client can't produce and consume data, this pr fixes that behavior, If the cluster is configured with anonymousUserRole, it should skip the authenticationProvider's checks

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@tuteng tuteng changed the title Fixed produce and consume when anonymousUserRole enabled [fix][broker]Fixed produce and consume when anonymousUserRole enabled Sep 23, 2023
@github-actions
Copy link

@tuteng Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@tuteng tuteng added type/bug The PR fixed a bug or issue reported a bug area/broker area/security labels Sep 23, 2023
@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Sep 23, 2023
@tuteng
Copy link
Member Author

tuteng commented Sep 23, 2023

Will update test and comment later

Copy link
Member

@mattisonchao mattisonchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test for it. :)

@tuteng
Copy link
Member Author

tuteng commented Sep 23, 2023

Please add a test for it. :)

Fixed

@codecov-commenter
Copy link

Codecov Report

Merging #21237 (310623d) into master (be4ab66) will increase coverage by 38.55%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #21237       +/-   ##
=============================================
+ Coverage     34.63%   73.19%   +38.55%     
- Complexity    12097    32484    +20387     
=============================================
  Files          1698     1887      +189     
  Lines        130451   140142     +9691     
  Branches      14252    15428     +1176     
=============================================
+ Hits          45187   102576    +57389     
+ Misses        79262    29475    -49787     
- Partials       6002     8091     +2089     
Flag Coverage Δ
inttests 24.15% <0.00%> (?)
systests 24.75% <0.00%> (-0.09%) ⬇️
unittests 72.49% <100.00%> (+40.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...va/org/apache/pulsar/broker/service/ServerCnx.java 71.76% <100.00%> (+32.32%) ⬆️

... and 1467 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants