-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Broker] Adjust the validation for policy schemaCompatibilityStrategy #14061
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
[Broker] Adjust the validation for policy schemaCompatibilityStrategy #14061
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
Jason918
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
nodece
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
CN you please remember me the PIP in which we are changing all the permissions?
@eolivelli Sorry, I should make a PIP for #13297. Do we need to make PIR for these changes? |
|
I mean that during the past months I have seen many patches around permission validation. |
|
Could we add a test for this? |
|
@yuruguo The change looks good to me, could you please help add a test? |
|
@eolivelli We don't have a release that contains #13297, so it will not have a big impact on security. The issue is #13297 implementation does not follow the current topic policy permission handling way.
😭, looks this is a feature #6428 that was added almost 2 years ago, and no PIP there. |
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Show resolved
Hide resolved
|
@codelipenghui @315157973 @gaoran10 The test has added and PTAL again, thx! |
|
After checking the current implementation, looks like the PolicyName and PolicyOperation are only for the exception messages, only the tenant admin can access the topic policies. |
Motivation
In #13297, We should not add
GET_SCHEMA_COMPATIBILITY_STRATEGYandSET_SCHEMA_COMPATIBILITY_STRATEGYtopic operation and complete the permission check on policy schemaCompatibilityStrategy by methodvalidateTopicOperationAsync(), because schemaCompatibilityStrategy is a topic policy not a topic operation, we should use methodvalidateTopicPolicyOperation()to complete.Documentation
no-need-doc