[Authorization] Role with namespace produce authz can also get topics#13773
[Authorization] Role with namespace produce authz can also get topics#13773codelipenghui merged 1 commit intoapache:masterfrom yuruguo:role_with_namespace_produce_authz_can_get_topics
Conversation
| log.debug("Namespace [{}] Role [{}] exception occurred while trying to check " | ||
| + "Consume permissions. {}", namespaceName, role, ex.getMessage()); | ||
| } | ||
| finalResult.completeExceptionally(e); |
There was a problem hiding this comment.
Something strange here, do we need e or ex ?
Besides, we need getCause() in the exception of CompletableFuture, otherwise, we will get CompletionException
There was a problem hiding this comment.
- we need
exin finalResult.completeExceptionally(). - I has used
getCause().
PTAL again.
eolivelli
left a comment
There was a problem hiding this comment.
good work
I left some feedback
...common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java
Outdated
Show resolved
Hide resolved
| return; | ||
| } | ||
| } else { | ||
| if (log.isDebugEnabled()) { |
There was a problem hiding this comment.
we cannot let pass every exception
we should fall back to checking the second action only in case of missing authentication, otherwise if there is a system error (system overloaded?) we are going to generate the error twice
There was a problem hiding this comment.
we cannot let pass every exception
If there is an exception or error when checking the first action and we end the subsequent checks, so even if the user has the second permission and it will not take effect. Does this not meet expectations?
we should fall back to checking the second action only in case of missing authentication
I traced the implementation of allowTheSpecifiedActionOpsAsync and not found exceptions related to authentication, so I can't tell whether to perform the second check.
In addition, the implementation logic of this PR is similar canLookupAsync, as follows:
…apache#13773) (cherry picked from commit 89d60af) (cherry picked from commit b172fc8)
|
Add the |
Motivation
From this comment
Role with namespace
produceorconsumeauthz can get topics.Documentation
no-need-doc