Add new tenant operation LIST_ANTI_AFFINITY_NAMESPACES and fix validation of getAntiAffinityNamespaces - #13723
Add new tenant operation LIST_ANTI_AFFINITY_NAMESPACES and fix validation of getAntiAffinityNamespaces#13723equanz wants to merge 1 commit into
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. 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 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