storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [4/7] storm git commit: Using real user-id in the ReqContext instead of username in PlainSaslTransportPlugin
Date Mon, 07 Mar 2016 20:29:39 GMT
Using real user-id in the ReqContext instead of username in PlainSaslTransportPlugin


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/5e2d44df
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/5e2d44df
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/5e2d44df

Branch: refs/heads/master
Commit: 5e2d44df8c342d29d723ac4ac90d0e1efb6884bb
Parents: 4e04ce8
Author: Kishor Patil <kpatil@yahoo-inc.com>
Authored: Wed Mar 2 12:32:00 2016 -0600
Committer: Kishor Patil <kpatil@yahoo-inc.com>
Committed: Wed Mar 2 12:32:00 2016 -0600

----------------------------------------------------------------------
 .../security/auth/plain/PlainClientCallbackHandler.java  |  2 +-
 .../security/auth/plain/PlainServerCallbackHandler.java  | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/5e2d44df/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainClientCallbackHandler.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainClientCallbackHandler.java
b/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainClientCallbackHandler.java
index 1350bdf..13340df 100644
--- a/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainClientCallbackHandler.java
+++ b/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainClientCallbackHandler.java
@@ -25,7 +25,7 @@ public class PlainClientCallbackHandler extends AbstractSaslClientCallbackHandle
      * For plain, using constants for a pair of user name and password.
      */
     public PlainClientCallbackHandler() {
-        _username = USERNAME;
+        _username = System.getProperty("user.name");
         _password = PASSWORD;
     }
 }

http://git-wip-us.apache.org/repos/asf/storm/blob/5e2d44df/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainServerCallbackHandler.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainServerCallbackHandler.java
b/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainServerCallbackHandler.java
index da16825..c646fc9 100644
--- a/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainServerCallbackHandler.java
+++ b/storm-core/src/jvm/org/apache/storm/security/auth/plain/PlainServerCallbackHandler.java
@@ -39,10 +39,17 @@ import javax.security.sasl.RealmCallback;
  * SASL server side callback handler
  */
 public class PlainServerCallbackHandler extends AbstractSaslServerCallbackHandler {
+    private static final Logger LOG = LoggerFactory.getLogger(PlainServerCallbackHandler.class);
+    public static final String PASSWORD = "password";
 
     public PlainServerCallbackHandler() throws IOException {
-        userName="username";
-        credentials.put("username", "password");
+        userName=null;
+    }
+
+    protected void handlePasswordCallback(PasswordCallback pc) {
+        LOG.debug("handlePasswordCallback");
+        pc.setPassword(PASSWORD.toCharArray());
+
     }
 
 }


Mime
View raw message