-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add new tenant operation LIST_ANTI_AFFINITY_NAMESPACES and fix validation of getAntiAffinityNamespaces #13723
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
base: master
Are you sure you want to change the base?
Conversation
|
@equanz After the change, how do the users using the old version migrate to the new version? We will introduce a breaking change in this PR, we should discuss in the dev email thread first. |
|
@codelipenghui Sorry for the late reply. If user defines custom authz provider and follow By the way, I think the validation method may throw NPE when using default authz provider org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider. Line 598 in 8c8738f
Therefore, it is one of issue fix for default authz provider. Moreover, this endpoint doesn't return correct value in the latest version. (Please see #13644) |
|
One of the alternative approaches is using an existing definition of operation. For example, validate pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java Line 1886 in 8c8738f
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java Lines 1888 to 1898 in 8c8738f
This approach doesn't add a new definition of operation. However, it requires Another approach is using only |
|
@codelipenghui Could you check these comments please? |
|
The pr had no activity for 30 days, mark with Stale label. |
e8175c7 to
db1d6f3
Compare
db1d6f3 to
9adf620
Compare
9adf620 to
97a49b1
Compare
97a49b1 to
0dc11ae
Compare
0dc11ae to
84300ce
Compare
|
The pr had no activity for 30 days, mark with Stale label. |
Motivation
Since #6428, we can define authz policy to each namespace operation.
However, I think the operation policy
validateNamespacePolicyOperation(namespaceName, PolicyName.ANTI_AFFINITY, PolicyOperation.READ);is not suitable forgetAntiAffinityNamespacesmethod because this method is a tenant-wise operation. (is not specific namespace-wise operation)Currently, the validation method throws NPE when using default authz provider org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider.
#13723 (comment)
Modifications
LIST_ANTI_AFFINITY_NAMESPACESLIST_ANTI_AFFINITY_NAMESPACESIf this approach is not accepted, I think we can use an existing operation like
LIST_NAMESPACESinstead of adding a new tenant operation.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
no-need-doc