manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1503092 - /manifoldcf/branches/CONNECTORS-737/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Date Mon, 15 Jul 2013 00:43:02 GMT
Author: kwright
Date: Mon Jul 15 00:43:02 2013
New Revision: 1503092

URL: http://svn.apache.org/r1503092
Log:
Make CMIS connector safe for passwords

Modified:
    manifoldcf/branches/CONNECTORS-737/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java

Modified: manifoldcf/branches/CONNECTORS-737/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-737/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1503092&r1=1503091&r2=1503092&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-737/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-737/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Mon Jul 15 00:43:02 2013
@@ -55,6 +55,7 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
 import org.apache.manifoldcf.core.interfaces.ConfigParams;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
@@ -699,7 +700,7 @@ public class CmisRepositoryConnector ext
   *@param newMap is the map to fill in
   *@param parameters is the current set of configuration parameters
   */
-  private static void fillInServerConfigurationMap(Map<String,String> newMap, ConfigParams
parameters)
+  private static void fillInServerConfigurationMap(Map<String,String> newMap, IPasswordMapperActivity
mapper, ConfigParams parameters)
   {
     String username = parameters.getParameter(CmisConfig.USERNAME_PARAM);
     String password = parameters.getParameter(CmisConfig.PASSWORD_PARAM);
@@ -714,6 +715,8 @@ public class CmisRepositoryConnector ext
       username = StringUtils.EMPTY;
     if(password == null)
       password = StringUtils.EMPTY;
+    else
+      password = mapper.mapPasswordToKey(password);
     if(protocol == null)
       protocol = CmisConfig.PROTOCOL_DEFAULT_VALUE;
     if(server == null)
@@ -758,7 +761,7 @@ public class CmisRepositoryConnector ext
     Map<String,String> paramMap = new HashMap<String,String>();
   
     // Fill in map from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     outputResource(VIEW_CONFIG_FORWARD, out, locale, paramMap);
   }
@@ -791,7 +794,7 @@ public class CmisRepositoryConnector ext
     Map<String,String> paramMap = new HashMap<String,String>();
 
     // Fill in the parameters from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     // Output the Javascript - only one Velocity template for all tabs
     outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, paramMap);
@@ -809,7 +812,7 @@ public class CmisRepositoryConnector ext
     // Set the tab name
     paramMap.put("TabName", tabName);
     // Fill in the parameters
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
     outputResource(EDIT_CONFIG_FORWARD_SERVER, out, locale, paramMap);
   
   }
@@ -848,7 +851,7 @@ public class CmisRepositoryConnector ext
 
     String password = variableContext.getParameter(CmisConfig.PASSWORD_PARAM);
     if (password != null)
-      parameters.setParameter(CmisConfig.PASSWORD_PARAM, password);
+      parameters.setParameter(CmisConfig.PASSWORD_PARAM, variableContext.mapKeyToPassword(password));
 
     String protocol = variableContext.getParameter(CmisConfig.PROTOCOL_PARAM);
     if (protocol != null) {



Mime
View raw message