michaeljmarshall commented on code in PR #19295:
URL: https://github.com/apache/pulsar/pull/19295#discussion_r1082976985
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/OneStageAuthenticationState.java:
##########
@@ -61,13 +80,47 @@ public AuthenticationDataSource getAuthDataSource() {
return authenticationDataSource;
}
+ /**
+ * Warning: this method is not intended to be called concurrently.
+ */
+ @Override
+ public CompletableFuture<AuthData> authenticateAsync(AuthData authData) {
+ if (authRole != null) {
+ // Authentication is already completed
+ return CompletableFuture.completedFuture(null);
+ }
+ this.authenticationDataSource = new AuthenticationDataCommand(
Review Comment:
Since this is a class for single stage authentication, there are no
`AuthChallenges`. The primary reason to set this here instead of the
constructor is that we set it with the `authData` that we authenticate. Note
that this class always has `isExpired` return `false`, which means there are
never any `AuthChallenges` generated.
If this were a multi-stage auth, this solution would not work.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]