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

[improve][broker] Add fine-grain authorization to ns/topic management endpoints #22305

Merged
merged 7 commits into from
Mar 20, 2024

Conversation

Technoboy-
Copy link
Contributor

Motivation

Add fine-grain authorization to ns/topic management endpoints so that it can be controlled at a more fine-grain level.

Modification

  • TRIM_TOPIC was missing, this would cause the normal user throw IllegalStateException not NotAuthorizedException.
  • adding fine-grain authorization to internalSetProperty, internalSetProperties, internalGetProperty, internalGetProperties, internalRemoveProperty, internalClearProperties, internalUnloadTopic,internalGetManagedLedgerInfo, internalGetPartitionedStats, internalGetPartitionedStatsInternal, internalCreateSubscription, internalUpdateSubscriptionProperties, internalAnalyzeSubscriptionBacklog, internalGetSubscriptionProperties, internalCreateMissedPartitions

Verifying this change

  • Add fine-grain authorization test coverage to NamespaceAuthZTest and TopicAuthZTest

Documentation

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

@Technoboy- Technoboy- self-assigned this Mar 19, 2024
@Technoboy- Technoboy- added this to the 3.3.0 milestone Mar 19, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Mar 19, 2024
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM. Please check the test failure

@codelipenghui
Copy link
Contributor

@Technoboy- I have removed the 3.1 release label since 3.1 is out of the support scope. You can get the release policy in this page

@Technoboy-
Copy link
Contributor Author

@Technoboy- I have removed the 3.1 release label since 3.1 is out of the support scope. You can get the release policy in this page

Ok

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 92.95775% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 73.62%. Comparing base (bbc6224) to head (b7c4bac).
Report is 68 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22305      +/-   ##
============================================
+ Coverage     73.57%   73.62%   +0.04%     
+ Complexity    32624    32183     -441     
============================================
  Files          1877     1887      +10     
  Lines        139502   139471      -31     
  Branches      15299    15293       -6     
============================================
+ Hits         102638   102684      +46     
+ Misses        28908    28824      -84     
- Partials       7956     7963       +7     
Flag Coverage Δ
inttests 26.87% <49.29%> (+2.28%) ⬆️
systests 24.39% <6.33%> (+0.06%) ⬆️
unittests 72.90% <92.95%> (+0.06%) ⬆️

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

Files Coverage Δ
...ker/authorization/PulsarAuthorizationProvider.java 68.92% <ø> (+0.30%) ⬆️
.../org/apache/pulsar/broker/admin/AdminResource.java 76.88% <100.00%> (-0.74%) ⬇️
...pache/pulsar/broker/admin/impl/NamespacesBase.java 74.63% <100.00%> (+1.55%) ⬆️
...pulsar/broker/admin/impl/PersistentTopicsBase.java 66.21% <86.11%> (+0.76%) ⬆️

... and 106 files with indirect coverage changes

@codelipenghui codelipenghui merged commit fd34d4a into apache:master Mar 20, 2024
50 checks passed
@Technoboy-
Copy link
Contributor Author

Cherry-picked to branch-3.0 by #22309

lhotari pushed a commit that referenced this pull request Mar 20, 2024
… endpoints (#22305)

(cherry picked from commit fd34d4a)

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
lhotari pushed a commit that referenced this pull request Mar 20, 2024
… endpoints (#22305)

(cherry picked from commit fd34d4a)

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
(cherry picked from commit 99eb49a)

# Conflicts:
#	pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
(cherry picked from commit 5c4f4cb)

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java
lhotari pushed a commit that referenced this pull request Mar 20, 2024
… endpoints (#22305)

(cherry picked from commit fd34d4a)

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
(cherry picked from commit 99eb49a)

# Conflicts:
#	pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
lhotari added a commit that referenced this pull request Mar 20, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 28, 2024
… endpoints (apache#22305)

(cherry picked from commit fd34d4a)

 Conflicts:
	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 28, 2024
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 2, 2024
… endpoints (apache#22305)

(cherry picked from commit fd34d4a)

 Conflicts:
	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 5, 2024
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 13, 2024
… endpoints (apache#22305)

(cherry picked from commit fd34d4a)

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
(cherry picked from commit 99eb49a)

# Conflicts:
#	pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
(cherry picked from commit 5c4f4cb)

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 13, 2024
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.

None yet

6 participants