You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2023/10/10 07:45:53 UTC

[PR] [bug] Fix MultiRoles token provider when using anonymous clients [pulsar]

merlimat opened a new pull request, #21338:
URL: https://github.com/apache/pulsar/pull/21338

   <!-- Either this PR fixes an issue, -->
   
   ### Motivation
   
   MultiRolesTokenProvider is failing with NPE when user is connecting without passing any credential, even though anonymous access is enabled and the client connections should be assigned the configured anonymous role name.
   
   
   
   <!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
   
   ### Modifications
   
   <!-- Describe the modifications you've done. -->
   
   ### 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:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *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
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][bug] Fix MultiRoles token provider when using anonymous clients [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #21338:
URL: https://github.com/apache/pulsar/pull/21338#issuecomment-1755239857

   /pulsarbot rerun-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][sec] Fix MultiRoles token provider when using anonymous clients [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #21338:
URL: https://github.com/apache/pulsar/pull/21338#issuecomment-1755379970

   checkstyle fails with error `Error:  src/main/java/org/apache/pulsar/broker/authorization/MultiRolesTokenAuthorizationProvider.java:[199] (sizes) LineLength: Line is longer than 120 characters (found 122).`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][sec] Fix MultiRoles token provider when using anonymous clients [pulsar]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #21338:
URL: https://github.com/apache/pulsar/pull/21338#issuecomment-1755644554

   ## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#21338](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (af8e98f) into [master](https://app.codecov.io/gh/apache/pulsar/commit/8438e43fb02b6d8df29672c6460a2f3da924ab60?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (8438e43) will **increase** coverage by `36.39%`.
   > Report is 8 commits behind head on master.
   > The diff coverage is `70.45%`.
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/21338/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@              Coverage Diff              @@
   ##             master   #21338       +/-   ##
   =============================================
   + Coverage     36.84%   73.24%   +36.39%     
   - Complexity    12229    32526    +20297     
   =============================================
     Files          1699     1888      +189     
     Lines        130559   140253     +9694     
     Branches      14264    15443     +1179     
   =============================================
   + Hits          48106   102722    +54616     
   + Misses        76121    29438    -46683     
   - Partials       6332     8093     +1761     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/21338/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/21338/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.22% <25.00%> (-0.12%)` | :arrow_down: |
   | [systests](https://app.codecov.io/gh/apache/pulsar/pull/21338/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.80% <25.00%> (+0.07%)` | :arrow_up: |
   | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/21338/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.53% <70.45%> (+40.58%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...org/apache/bookkeeper/mledger/LedgerOffloader.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9MZWRnZXJPZmZsb2FkZXIuamF2YQ==) | `72.22% <ø> (+72.22%)` | :arrow_up: |
   | [...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9pbXBsL01hbmFnZWRMZWRnZXJJbXBsLmphdmE=) | `80.80% <100.00%> (+32.48%)` | :arrow_up: |
   | [...e/bookkeeper/mledger/impl/NullLedgerOffloader.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9pbXBsL051bGxMZWRnZXJPZmZsb2FkZXIuamF2YQ==) | `35.71% <ø> (+7.14%)` | :arrow_up: |
   | [...areness/IsolatedBookieEnsemblePlacementPolicy.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9ib29raWUvcmFja2F3YXJlbmVzcy9Jc29sYXRlZEJvb2tpZUVuc2VtYmxlUGxhY2VtZW50UG9saWN5LmphdmE=) | `87.02% <100.00%> (+87.02%)` | :arrow_up: |
   | [...va/org/apache/pulsar/broker/service/ServerCnx.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1NlcnZlckNueC5qYXZh) | `71.76% <100.00%> (+30.24%)` | :arrow_up: |
   | [...n/java/org/apache/pulsar/broker/service/Topic.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1RvcGljLmphdmE=) | `36.36% <ø> (+28.03%)` | :arrow_up: |
   | [...esystem/impl/FileSystemManagedLedgerOffloader.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-dGllcmVkLXN0b3JhZ2UvZmlsZS1zeXN0ZW0vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9vZmZsb2FkL2ZpbGVzeXN0ZW0vaW1wbC9GaWxlU3lzdGVtTWFuYWdlZExlZGdlck9mZmxvYWRlci5qYXZh) | `68.04% <ø> (ø)` | |
   | [...d/jcloud/impl/BlobStoreManagedLedgerOffloader.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-dGllcmVkLXN0b3JhZ2UvamNsb3VkL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ib29ra2VlcGVyL21sZWRnZXIvb2ZmbG9hZC9qY2xvdWQvaW1wbC9CbG9iU3RvcmVNYW5hZ2VkTGVkZ2VyT2ZmbG9hZGVyLmphdmE=) | `75.18% <ø> (ø)` | |
   | [...ava/org/apache/pulsar/broker/service/Producer.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1Byb2R1Y2VyLmphdmE=) | `82.64% <75.00%> (+20.21%)` | :arrow_up: |
   | [...rization/MultiRolesTokenAuthorizationProvider.java](https://app.codecov.io/gh/apache/pulsar/pull/21338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9icm9rZXIvYXV0aG9yaXphdGlvbi9NdWx0aVJvbGVzVG9rZW5BdXRob3JpemF0aW9uUHJvdmlkZXIuamF2YQ==) | `59.18% <57.14%> (+59.18%)` | :arrow_up: |
   
   ... and [1441 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/21338/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][sec] Fix MultiRoles token provider when using anonymous clients [pulsar]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #21338:
URL: https://github.com/apache/pulsar/pull/21338


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][sec] Fix MultiRoles token provider when using anonymous clients [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #21338:
URL: https://github.com/apache/pulsar/pull/21338#issuecomment-1755391212

   I pushed a fix for the checkstyle issue so that CI would run.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org