tuteng commented on a change in pull request #14044:
URL: https://github.com/apache/pulsar/pull/14044#discussion_r807743539
##########
File path:
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderToken.java
##########
@@ -330,12 +356,20 @@ public String getAuthRole() throws
AuthenticationException {
return provider.getPrincipal(jwt);
}
+ /**
+ * Here is an explanation of why the null value is returned.
+ *
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationState.java#L49
+ */
@Override
public AuthData authenticate(AuthData authData) throws
AuthenticationException {
String token = new String(authData.getBytes(), UTF_8);
this.jwt = provider.authenticateToken(token);
- this.authenticationDataSource = new
AuthenticationDataCommand(token, remoteAddress, sslSession);
+ if (authHttpState) {
+ this.authenticationDataSource = new
AuthenticationDataHttps(this.request);
+ } else {
+ this.authenticationDataSource = new
AuthenticationDataCommand(token, remoteAddress, sslSession);
+ }
Review comment:
Fixed
--
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]