michaeljmarshall opened a new pull request, #19295:
URL: https://github.com/apache/pulsar/pull/19295

   PIP: #12105
   
   ### Motivation
   
   In order to implement PIP 97, we must replace `authenticate` calls with 
`authenticateAsync`. This PR makes those changes for 
`OneStageAuthenticationState`. It also moves the call to authenticate the 
`AuthData` out of the constructor and into the `authenticateAsync` method.
   
   One assumption I make in this PR, is that there will not be concurrent calls 
to the same `AuthenticationState#authenticateAsync` method. That seems like a 
reasonable assumption because Pulsar uses this state object in the netty 
eventloop handlers, but please let me know if you disagree.
   
   ### Modifications
   
   * Move the `authenticate` call out of the constructor so that authentication 
is only done on the first pass through the `authenticateAsync` method.
   * Make `authenticate` backwards compatible for any plugins that are using it.
   
   ### Verifying this change
   
   New tests are added to verify the new and the old code.
   
   ### Does this pull request potentially affect one of the following parts:
   
   This could break 3rd party plugins in the broker if they were relying on 
authentication to happen in the constructor. In order to make those 
implementations fail fast, this PR includes a change to throw an exception when 
the `getAuthRole` is called without first calling `authenticateAsync` or 
`authenticate`. That makes these changes semi-backwards compatible.
   
   ### Documentation
   
   - [x] `doc-not-needed`
   
   ### Matching PR in forked repository
   
   PR in forked repository: https://github.com/michaeljmarshall/pulsar/pull/17


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to