manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sch...@apache.org
Subject svn commit: r1784398 - in /manifoldcf/trunk: CHANGES.txt connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
Date Sat, 25 Feb 2017 18:07:21 GMT
Author: schuch
Date: Sat Feb 25 18:07:21 2017
New Revision: 1784398

URL: http://svn.apache.org/viewvc?rev=1784398&view=rev
Log:
Fix for CONNECTORS-1384

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1784398&r1=1784397&r2=1784398&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Sat Feb 25 18:07:21 2017
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 2.7-dev =====================
 
+CONNECTORS-1384: Fix GridFS connector not to send the password
+to the client in plaintext and enabled password obfuscation
+(Markus Schuch)
+
 CONNECTORS-1385: Confluence connector was constructing bad paths
 which confused CF 6.4.
 (Andrew Shumway, Karl Wright)

Modified: manifoldcf/trunk/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java?rev=1784398&r1=1784397&r2=1784398&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
(original)
+++ manifoldcf/trunk/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
Sat Feb 25 18:07:21 2017
@@ -192,7 +192,7 @@ public class GridFSRepositoryConnector e
     public void connect(ConfigParams configParams) {
         super.connect(configParams);
         username = params.getParameter(GridFSConstants.USERNAME_PARAM);
-        password = params.getParameter(GridFSConstants.PASSWORD_PARAM);
+        password = params.getObfuscatedParameter(GridFSConstants.PASSWORD_PARAM);
         host = params.getParameter(GridFSConstants.HOST_PARAM);
         port = params.getParameter(GridFSConstants.PORT_PARAM);
         db = params.getParameter(GridFSConstants.DB_PARAM);
@@ -642,7 +642,7 @@ public class GridFSRepositoryConnector e
 
         String password = variableContext.getParameter(GridFSConstants.PASSWORD_PARAM);
         if (password != null) {
-            parameters.setParameter(GridFSConstants.PASSWORD_PARAM, variableContext.mapKeyToPassword(password));
+            parameters.setObfuscatedParameter(GridFSConstants.PASSWORD_PARAM, variableContext.mapKeyToPassword(password));
         }
 
         String db = variableContext.getParameter(GridFSConstants.DB_PARAM);
@@ -774,8 +774,12 @@ public class GridFSRepositoryConnector e
         String usernameParam = parameters.getParameter(GridFSConstants.USERNAME_PARAM);
         paramMap.put(GridFSConstants.USERNAME_PARAM, usernameParam);
 
-        String passwordParam = parameters.getParameter(GridFSConstants.PASSWORD_PARAM);
-        passwordParam = mapper.mapKeyToPassword(passwordParam);
+        String passwordParam = parameters.getObfuscatedParameter(GridFSConstants.PASSWORD_PARAM);
+        if (passwordParam == null) {
+          passwordParam = StringUtils.EMPTY;
+        } else {
+          passwordParam = mapper.mapPasswordToKey(passwordParam);
+        }
         paramMap.put(GridFSConstants.PASSWORD_PARAM, passwordParam);
 
         String dbParam = parameters.getParameter(GridFSConstants.DB_PARAM);



Mime
View raw message