-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Authorization] Return if namespace policies are read only #12514
[Authorization] Return if namespace policies are read only #12514
Conversation
@rdhabalia, @lhotari, @merlimat - PTAL |
/pulsarbot run-failure-checks |
@michaeljmarshall:Thanks for your contribution. For this PR, do we need to update docs? |
In order to cherry-pick this commit to older branches without also affecting the asynchronous code, I am going to re-open this PR. I'll submit a follow up that will make this method actually async. |
Why dis you add the 'cherry picked' labels? |
@eolivelli - thanks for your question. I meant to put release labels, but instead used the cherry-picked label. I fixed it now. I'll merge this when tests pass and then I'll cherry pick to the old branches. |
* [Authorization Provider] Return early when namespace policies are read only * Remove typo fix to simplify cherry-picking (cherry picked from commit f1e72d6)
* [Authorization Provider] Return early when namespace policies are read only * Remove typo fix to simplify cherry-picking (cherry picked from commit f1e72d6)
* [Authorization Provider] Return early when namespace policies are read only * Remove typo fix to simplify cherry-picking (cherry picked from commit f1e72d6)
Motivation
This is a minor fix to a flow control in the default
PulsarAuthorizationProvider
class. Currently, when the policies are "read only", thegrantPermissionAsync
method will complete the future with a failure but then proceed to attempt to update the policy anyway.Modifications
Verifying this change
This section of the code does not have good test coverage, so it wouldn't be very easy to add a test for this small case. Since this fix is small and easy to understand, I think it is safe to merge it without adding a test. Ideally, we'll come back and add tests for this part of the code base.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
no-need-doc
It is a small change to internal behavior.