[cleanup][broker] Validate originalPrincipal earlier in ServerCnx - #19270
Conversation
michaeljmarshall
left a comment
There was a problem hiding this comment.
There are some edge cases in the current solution that I think will require larger refactoring. Converting this to a draft for now.
I removed this logic from the PR to make it easier to accept. It would be good to submit a follow up PR to propose making the broker's logic stricter. |
|
@lhotari @nicoloboschi PTAL. |
|
/pulsarbot rerun-failure-checks |
|
I cherry-picked this change to the release branches because #19455 depends on it. |
…ache#19270) (cherry picked from commit fd3ce8b) (cherry picked from commit 2847dd1) (cherry picked from commit 01bd986)
…rCnx (apache#19270)" This reverts commit b233d6b.
…ache#19270) (cherry picked from commit fd3ce8b) (cherry picked from commit 2847dd1) (cherry picked from commit 01bd986)
|
Hi @michaeljmarshall did you have any plans to update the protocol spec for this cleanup? Just want to make sure it can catch up with the release schedule. |
|
The docs were updated here: apache/pulsar-site#408. |
Motivation
The current
ServerCnxvalidates the proxy role on certain protocol messages. This is unnecessary. Instead, we should verify that theauthRoleand theoriginalPrincipalare a valid combination before going to theConnectedstate.Modifications
invalidOriginalPrincipalwithvalidateRoleAndOriginalPrincipal.invalidOriginalPrincipal.validateRoleAndOriginalPrincipalwhen transitioning fromConnectingtoConnectedstate.Verifying this change
Added new test in
ServerCnxTestto validate the authorization.Documentation
doc-requiredI updated the appropriate Javadocs, but we should also update the protocol spec to indicate valid combinations of the
Connectcommand.Matching PR in forked repository
PR in forked repository: michaeljmarshall#13