You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by zh...@apache.org on 2020/03/13 06:10:49 UTC
[pulsar] 08/17: fix the bug of authenticationData is't initialized.
(#6440)
This is an automated email from the ASF dual-hosted git repository.
zhaijia pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit db14c7902552415064599b2164d388d22d85fa10
Author: bilahepan <YT...@gmail.com>
AuthorDate: Sat Feb 29 08:59:08 2020 +0800
fix the bug of authenticationData is't initialized. (#6440)
Motivation
fix the bug of authenticationData is't initialized.
the method org.apache.pulsar.proxy.server.ProxyConnection#handleConnect can't init the value of authenticationData.
cause of the bug that you will get the null value form the method org.apache.pulsar.broker.authorization.AuthorizationProvider#canConsumeAsync
when implements org.apache.pulsar.broker.authorization.AuthorizationProvider interface.
Modifications
init the value of authenticationData from the method org.apache.pulsar.proxy.server.ProxyConnection#handleConnect.
Verifying this change
implements org.apache.pulsar.broker.authorization.AuthorizationProvider interface, and get the value of authenticationData.
(cherry picked from commit b8f0ca092b6c6cbd04525fb81ea55ba516a06cf7)
---
.../src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
index d9960c5..9b8b7fb 100644
--- a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
+++ b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
@@ -327,6 +327,7 @@ public class ProxyConnection extends PulsarHandler implements FutureListener<Voi
}
authState = authenticationProvider.newAuthState(clientData, remoteAddress, sslSession);
+ authenticationData = authState.getAuthDataSource();
doAuthentication(clientData);
} catch (Exception e) {
LOG.warn("[{}] Unable to authenticate: ", remoteAddress, e);