manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1670616 - in /manifoldcf/branches/dev_1x: ./ connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/ framework/ framework/api-service/src/main/webapp/WEB-INF/ framework/api-servlet/src/main/...
Date Wed, 01 Apr 2015 11:06:04 GMT
Author: kwright
Date: Wed Apr  1 11:06:03 2015
New Revision: 1670616

URL: http://svn.apache.org/r1670616
Log:
Pull up fix for CONNECTORS-1177 and CONNECTORS-1178 from trunk.

Added:
    manifoldcf/branches/dev_1x/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/beans/APIProfile.java
      - copied unchanged from r1670614, manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/beans/APIProfile.java
Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/CHANGES.txt
    manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java
    manifoldcf/branches/dev_1x/framework/   (props changed)
    manifoldcf/branches/dev_1x/framework/api-service/src/main/webapp/WEB-INF/web.xml
    manifoldcf/branches/dev_1x/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java
    manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
    manifoldcf/branches/dev_1x/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java
    manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/Variable.java
    manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java
    manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableResult.java
    manifoldcf/branches/dev_1x/framework/script-example/file-crawl-example.mcf
    manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/how-to-build-and-deploy.xml
    manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/programmatic-operation.xml
    manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/how-to-build-and-deploy.xml
    manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/programmatic-operation.xml
    manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/how-to-build-and-deploy.xml
    manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/programmatic-operation.xml

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr  1 11:06:03 2015
@@ -47,6 +47,7 @@
 /manifoldcf/branches/CONNECTORS-1119:1645497-1647584
 /manifoldcf/branches/CONNECTORS-1130:1648217-1648685
 /manifoldcf/branches/CONNECTORS-1134:1649449-1649604
+/manifoldcf/branches/CONNECTORS-1177:1670213-1670613
 /manifoldcf/branches/CONNECTORS-120:1406712-1407974,1407982-1411043,1411049-1416451
 /manifoldcf/branches/CONNECTORS-120-1:1416450-1417056
 /manifoldcf/branches/CONNECTORS-13:1525862-1527182,1539324-1541634
@@ -121,4 +122,4 @@
 /manifoldcf/branches/CONNECTORS-981:1605049-1605773
 /manifoldcf/branches/CONNECTORS-989:1611600-1612101
 /manifoldcf/branches/CONNECTORS-990:1610284-1610707
-/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
 4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
 1660258,1660276,1661454,1665848,1666160,1666781,1666820,1669100,1669238,1669487,1669523,1669586,1669660
+/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
 4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
 1660258,1660276,1661454,1665848,1666160,1666781,1666820,1669100,1669238,1669487,1669523,1669586,1669660,1670614

Modified: manifoldcf/branches/dev_1x/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/CHANGES.txt?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/CHANGES.txt (original)
+++ manifoldcf/branches/dev_1x/CHANGES.txt Wed Apr  1 11:06:03 2015
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 1.9-dev =====================
 
+CONNECTORS-1177: Add session-based security for API.
+(Jan van Haarst, Karl Wright)
+
 CONNECTORS-1176: Update SolrJ version.
 (Karl Wright)
 

Modified: manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java (original)
+++ manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java Wed Apr  1 11:06:03 2015
@@ -63,7 +63,9 @@ public class APISanityTester
     ConfigurationNode child;
     Configuration requestObject;
     Configuration result;
-      
+
+    instance.loginAPI("","");
+    
     connectionObject = new ConfigurationNode("repositoryconnection");
     
     child = new ConfigurationNode("name");

Propchange: manifoldcf/branches/dev_1x/framework/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr  1 11:06:03 2015
@@ -113,4 +113,4 @@
 /manifoldcf/branches/CONNECTORS-989/framework:1611600-1612101
 /manifoldcf/branches/CONNECTORS-990/framework:1610284-1610707
 /manifoldcf/trunk:1629122
-/manifoldcf/trunk/framework:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1632013,1632289,1632844,1633108,1633193,1633202,1633348,1633364,1634145,1634148,1634155,1634264,1634373,1634530,1635438,1635809,1636146,1636180,1636207,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1639593,1639600,1640018,1640101,1640199,1640314,1640319,1640749,1640772,1640925,1640941,1641222,1641557,1641559,1
 641724,1641911,1642163,1642255,1642318,1644197,1644399,1646317,1646397,1646403,1646640,1647574,1647585,1647608,1649605,1650351,1650911,1651332,1651539,1651921,1655377,1655411,1657346,1658004,1658036,1660258,1660276,1669487
+/manifoldcf/trunk/framework:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1632013,1632289,1632844,1633108,1633193,1633202,1633348,1633364,1634145,1634148,1634155,1634264,1634373,1634530,1635438,1635809,1636146,1636180,1636207,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1639593,1639600,1640018,1640101,1640199,1640314,1640319,1640749,1640772,1640925,1640941,1641222,1641557,1641559,1
 641724,1641911,1642163,1642255,1642318,1644197,1644399,1646317,1646397,1646403,1646640,1647574,1647585,1647608,1649605,1650351,1650911,1651332,1651539,1651921,1655377,1655411,1657346,1658004,1658036,1660258,1660276,1669487,1670614

Modified: manifoldcf/branches/dev_1x/framework/api-service/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/api-service/src/main/webapp/WEB-INF/web.xml?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/api-service/src/main/webapp/WEB-INF/web.xml (original)
+++ manifoldcf/branches/dev_1x/framework/api-service/src/main/webapp/WEB-INF/web.xml Wed Apr  1 11:06:03 2015
@@ -34,7 +34,7 @@
   </servlet-mapping>
 
   <session-config>
-    <session-timeout>5</session-timeout>
+    <session-timeout>30</session-timeout>
   </session-config>
 
   <listener>

Modified: manifoldcf/branches/dev_1x/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java (original)
+++ manifoldcf/branches/dev_1x/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java Wed Apr  1 11:06:03 2015
@@ -24,6 +24,9 @@ import org.apache.manifoldcf.crawler.int
 import org.apache.manifoldcf.crawler.system.ManifoldCF;
 import org.apache.manifoldcf.crawler.system.Logging;
 import org.apache.manifoldcf.core.util.URLDecoder;
+
+import org.apache.manifoldcf.ui.beans.APIProfile;
+
 import java.io.*;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
@@ -53,6 +56,20 @@ public class APIServlet extends HttpServ
     super.destroy();
   }
 
+  protected APIProfile getAPISession(IThreadContext tc, HttpServletRequest request)
+  {
+    Object x = request.getSession().getAttribute("apiprofile");
+    if (x == null || !(x instanceof APIProfile))
+    {
+      // Basic login
+      APIProfile ap = new APIProfile();
+      request.getSession().setAttribute("apiprofile",ap);
+      ap.login(tc,"","");
+      return ap;
+    }
+    return (APIProfile)x;
+  }
+  
   /** The get method.
   */
   protected void doGet(HttpServletRequest request, HttpServletResponse response)
@@ -74,8 +91,10 @@ public class APIServlet extends HttpServ
         return;
       }
 
+      // Verify session
+      APIProfile ap = getAPISession(tc,request);
       // Perform the get
-      executeRead(tc,response,pathInfo,queryString);
+      executeRead(tc,response,pathInfo,queryString,ap);
     }
     catch (ManifoldCFException e)
     {
@@ -104,12 +123,14 @@ public class APIServlet extends HttpServ
         return;
       }
 
+      // Verify session
+      APIProfile ap = getAPISession(tc,request);
       // Get the content being 'put'
       InputStream content = request.getInputStream();
       try
       {
 	// Do the put.
-	executeWrite(tc,response,pathInfo,content);
+	executeWrite(tc,response,pathInfo,content,ap);
       }
       finally
       {
@@ -144,12 +165,14 @@ public class APIServlet extends HttpServ
         return;
       }
 
+      // Verify session
+      APIProfile ap = getAPISession(tc,request);
       // Get the content being posted
       InputStream content = request.getInputStream();
       try
       {
 	// Do the put.
-	executePost(tc,response,pathInfo,content);
+	executePost(tc,response,pathInfo,content,ap);
       }
       finally
       {
@@ -184,8 +207,10 @@ public class APIServlet extends HttpServ
         return;
       }
 
+      // Verify session
+      APIProfile ap = getAPISession(tc,request);
       // Perform the deletion
-      executeDelete(tc,response,pathInfo);
+      executeDelete(tc,response,pathInfo,ap);
       
     }
     catch (ManifoldCFException e)
@@ -197,12 +222,47 @@ public class APIServlet extends HttpServ
   }
 
   // Protected methods
+
+  protected static void sendUnauthorizedResponse(HttpServletResponse response)
+    throws IOException
+  {
+    response.setStatus(response.SC_UNAUTHORIZED);
+    sendNullJSON(response);
+  }
+  
+  protected static void sendNullJSON(HttpServletResponse response)
+    throws IOException
+  {
+    String loutputText = "{}";
+    byte[] lresponseValue = loutputText.getBytes(StandardCharsets.UTF_8);
+
+    // Set response mime type
+    response.setContentType("text/plain; charset=utf-8");
+    response.setIntHeader("Content-Length", (int)lresponseValue.length);
+    ServletOutputStream out = response.getOutputStream();
+    try
+    {
+      out.write(lresponseValue,0,lresponseValue.length);
+      out.flush();
+    }
+    finally
+    {
+      out.close();
+    }
+  }
   
   /** Perform a general "read" operation.
   */
-  protected static void executeRead(IThreadContext tc, HttpServletResponse response, String pathInfo, String queryString)
+  protected static void executeRead(IThreadContext tc, HttpServletResponse response, String pathInfo, String queryString, APIProfile ap)
     throws ManifoldCFException, IOException
   {
+    if (!ap.getLoggedOn())
+    {
+      // Login failed
+      sendUnauthorizedResponse(response);
+      return;
+    }
+
     // Strip off leading "/"
     if (pathInfo.startsWith("/"))
       pathInfo = pathInfo.substring(1);
@@ -280,9 +340,16 @@ public class APIServlet extends HttpServ
   
   /** Perform a general "write" operation.
   */
-  protected static void executeWrite(IThreadContext tc, HttpServletResponse response, String pathInfo, InputStream data)
+  protected static void executeWrite(IThreadContext tc, HttpServletResponse response, String pathInfo, InputStream data, APIProfile ap)
     throws ManifoldCFException, IOException
   {
+    if (!ap.getLoggedOn())
+    {
+      // Login failed
+      sendUnauthorizedResponse(response);
+      return;
+    }
+
     // Strip off leading "/"
     if (pathInfo.startsWith("/"))
       pathInfo = pathInfo.substring(1);
@@ -394,7 +461,7 @@ public class APIServlet extends HttpServ
 
   /** Perform a general "post" operation.
   */
-  protected static void executePost(IThreadContext tc, HttpServletResponse response, String pathInfo, InputStream data)
+  protected static void executePost(IThreadContext tc, HttpServletResponse response, String pathInfo, InputStream data, APIProfile ap)
     throws ManifoldCFException, IOException
   {
     // Strip off leading "/"
@@ -415,6 +482,57 @@ public class APIServlet extends HttpServ
       command = pathInfo.substring(index+1);
     }
 
+    // Security check.  If the protocol is JSON and the command is LOGIN, we do the login now.  But to
+    // prevent denial of service attacks, we don't accept more than a limited amount of login JSON.
+    if (protocol.equals("json") && command.equals("LOGIN")) {
+      // Do the login!
+      // Parse the json login packet
+      char[] lbuffer = new char[65536];
+      StringBuilder lsb = new StringBuilder();
+      Reader lr = new InputStreamReader(data,StandardCharsets.UTF_8);
+      while (true)
+      {
+        int amt = lr.read(lbuffer);
+        if (amt == -1)
+          break;
+        if (lsb.length() + amt > 65536)
+          break;
+        lsb.append(lbuffer,0,amt);
+      }
+      
+      Configuration loginInput = new Configuration();
+      loginInput.fromJSON(lsb.toString());
+
+      String userID = "";
+      String password = "";
+      for (int i = 0; i < loginInput.getChildCount(); i++)
+      {
+        ConfigurationNode cn = loginInput.findChild(i);
+        if (cn.getType().equals("userID"))
+          userID = cn.getValue();
+        else if (cn.getType().equals("password"))
+          password = cn.getValue();
+      }
+      ap.login(tc,userID,password);
+      if (!ap.getLoggedOn())
+      {
+        sendUnauthorizedResponse(response);
+        return;
+      }
+      else
+      {
+        sendNullJSON(response);
+        return;
+      }
+    }
+
+    if (!ap.getLoggedOn())
+    {
+      // Login failed
+      sendUnauthorizedResponse(response);
+      return;
+    }
+
     // We presume the data is utf-8
     StringBuilder sb = new StringBuilder();
     char[] buffer = new char[65536];
@@ -448,6 +566,7 @@ public class APIServlet extends HttpServ
     }
     
     // Execute the request.
+
     
     Configuration output = new Configuration();
     int writeResult = ManifoldCF.executePostCommand(tc,output,command,input);
@@ -505,9 +624,16 @@ public class APIServlet extends HttpServ
   
   /** Perform a general "delete" operation.
   */
-  protected static void executeDelete(IThreadContext tc, HttpServletResponse response, String pathInfo)
+  protected static void executeDelete(IThreadContext tc, HttpServletResponse response, String pathInfo, APIProfile ap)
     throws ManifoldCFException, IOException
   {
+    if (!ap.getLoggedOn())
+    {
+      // Login failed
+      sendUnauthorizedResponse(response);
+      return;
+    }
+
     // Strip off leading "/"
     if (pathInfo.startsWith("/"))
       pathInfo = pathInfo.substring(1);

Modified: manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java (original)
+++ manifoldcf/branches/dev_1x/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java Wed Apr  1 11:06:03 2015
@@ -89,6 +89,8 @@ public class ManifoldCF
   // Local member variables
   protected static String loginUserName = null;
   protected static String loginPassword = null;
+  protected static String apiLoginUserName = null;
+  protected static String apiLoginPassword = null;
   protected static String masterDatabaseName = null;
   protected static String masterDatabaseUsername = null;
   protected static String masterDatabasePassword = null;
@@ -112,7 +114,12 @@ public class ManifoldCF
   public static final String loginUserNameProperty = "org.apache.manifoldcf.login.name";
   /** UI login password */
   public static final String loginPasswordProperty = "org.apache.manifoldcf.login.password";
-  
+
+  /** API login user name */
+  public static final String apiLoginUserNameProperty = "org.apache.manifoldcf.apilogin.name";
+  /** API login password */
+  public static final String apiLoginPasswordProperty = "org.apache.manifoldcf.apilogin.password";
+
   // Database access properties
   /** Database name property */
   public static final String masterDatabaseNameProperty = "org.apache.manifoldcf.database.name";
@@ -171,6 +178,8 @@ public class ManifoldCF
         processID = null;
         loginUserName = null;
         loginPassword = null;
+        apiLoginUserName = null;
+        apiLoginPassword = null;
         masterDatabaseName = null;
         masterDatabaseUsername = null;
         masterDatabasePassword = null;
@@ -264,6 +273,9 @@ public class ManifoldCF
           loginUserName = LockManagerFactory.getStringProperty(threadContext,loginUserNameProperty,"admin");
           loginPassword = LockManagerFactory.getPossiblyObfuscatedStringProperty(threadContext,loginPasswordProperty,"admin");
 
+          apiLoginUserName = LockManagerFactory.getStringProperty(threadContext,apiLoginUserNameProperty,"");
+          apiLoginPassword = LockManagerFactory.getPossiblyObfuscatedStringProperty(threadContext,apiLoginPasswordProperty,"");
+
           masterDatabaseName = LockManagerFactory.getStringProperty(threadContext,masterDatabaseNameProperty,"dbname");
           masterDatabaseUsername = LockManagerFactory.getStringProperty(threadContext,masterDatabaseUsernameProperty,"manifoldcf");
           masterDatabasePassword = LockManagerFactory.getPossiblyObfuscatedStringProperty(threadContext,masterDatabasePasswordProperty,"local_pg_passwd");
@@ -637,6 +649,25 @@ public class ManifoldCF
     }
   }
 
+  /** Verify API login.
+  */
+  public static boolean verifyAPILogin(IThreadContext threadContext, String userID, String userPassword)
+    throws ManifoldCFException
+  {
+    if (userID != null && userPassword != null)
+    {
+      /*
+      IDBInterface database = DBInterfaceFactory.make(threadContext,
+        ManifoldCF.getMasterDatabaseName(),
+        ManifoldCF.getMasterDatabaseUsername(),
+        ManifoldCF.getMasterDatabasePassword());
+      */
+      // MHL to use a database table, when we get that sophisticated
+      return userID.equals(apiLoginUserName) &&  userPassword.equals(apiLoginPassword);
+    }
+    return false;
+  }
+
   /** Verify login.
   */
   public static boolean verifyLogin(IThreadContext threadContext, String userID, String userPassword)

Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java Wed Apr  1 11:06:03 2015
@@ -197,6 +197,19 @@ public class ManifoldCFInstance
   
   // These methods allow communication with the ManifoldCF api webapp, via the locally-instantiated jetty
   
+  public void loginAPI(String userID, String password)
+    throws Exception
+  {
+    Configuration requestObject = new Configuration();
+    ConfigurationNode cn = new ConfigurationNode("userID");
+    cn.setValue(userID);
+    requestObject.addChild(requestObject.getChildCount(),cn);
+    cn = new ConfigurationNode("password");
+    cn.setValue(password);
+    requestObject.addChild(requestObject.getChildCount(),cn);
+    performAPIPostOperationViaNodes("LOGIN",200,requestObject);
+  }
+  
   public void startJobAPI(String jobIDString)
     throws Exception
   {

Modified: manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/Variable.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/Variable.java?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/Variable.java (original)
+++ manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/Variable.java Wed Apr  1 11:06:03 2015
@@ -52,6 +52,8 @@ public interface Variable
   public static String ATTRIBUTE_NOTFOUNDSTATUS = "__NOTFOUND__";
   /** CREATED status attribute */
   public static String ATTRIBUTE_CREATEDSTATUS = "__CREATED__";
+  /** UNAUTHORIZED status attribute */
+  public static String ATTRIBUTE_UNAUTHORIZEDSTATUS = "__UNAUTHORIZED__";
   
   /** Check if the variable has a string value */
   public boolean hasStringValue()

Modified: manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java (original)
+++ manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java Wed Apr  1 11:06:03 2015
@@ -41,13 +41,16 @@ public class VariableConfiguration exten
     throws ScriptException
   {
     configuration = new Configuration();
-    try
+    if (json != null && json.length() > 0)
     {
-      configuration.fromJSON(json);
-    }
-    catch (ManifoldCFException e)
-    {
-      throw new ScriptException(e.getMessage(),e);
+      try
+      {
+        configuration.fromJSON(json);
+      }
+      catch (ManifoldCFException e)
+      {
+        throw new ScriptException("Invalid json: '"+json+"': "+e.getMessage(),e);
+      }
     }
   }
   

Modified: manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableResult.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableResult.java?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableResult.java (original)
+++ manifoldcf/branches/dev_1x/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableResult.java Wed Apr  1 11:06:03 2015
@@ -77,6 +77,8 @@ public class VariableResult extends Vari
       return new VariableBoolean(resultCode == 201);
     else if (attributeName.equals(ATTRIBUTE_NOTFOUNDSTATUS))
       return new VariableBoolean(resultCode == 404);
+    else if (attributeName.equals(ATTRIBUTE_UNAUTHORIZEDSTATUS))
+      return new VariableBoolean(resultCode == 401);
     else if (attributeName.equals(ATTRIBUTE_VALUE))
       return result;
     else

Modified: manifoldcf/branches/dev_1x/framework/script-example/file-crawl-example.mcf
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/script-example/file-crawl-example.mcf?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/script-example/file-crawl-example.mcf (original)
+++ manifoldcf/branches/dev_1x/framework/script-example/file-crawl-example.mcf Wed Apr  1 11:06:03 2015
@@ -17,14 +17,22 @@
 # Argument: the base path of the API service, e.g. "http://localhost:8345/mcf-api-service".
 
 # Decode the argument, if any
-if __args__.__size__ > 2 || __args__.__size__ < 1 then
-  error "Usage: file-crawl-example <file_path> [<url_path>]";
+if __args__.__size__ > 4 || __args__.__size__ < 1 || __args__.__size__ == 3 then
+  error "Usage: file-crawl-example <file_path> [ <url_path> [ <user_name> <password> ] ]";
 ;
 if __args__.__size__ == 1 then
   set basepath = "http://localhost:8345/mcf-api-service";
 else
   set basepath = __args__[1];
 ;
+if __args__.__size__ == 4 then
+  set username = __args__[2];
+  set password = __args__[3];
+else
+  set username = "";
+  set password = "";
+;
+
 set baseurl = (new url basepath) + "json";
 
 # Define all the connection names, job names, etc.
@@ -35,6 +43,17 @@ set repositoryConnectionDescription = "F
 set fileCrawlPath = __args__[0];
 set fileCrawlJobName = "File system crawl of "+fileCrawlPath;
 
+# First, login
+POST result = {
+  << "userID" : username :  :  >>,
+  << "password" : password : : >> }
+  to baseurl + "LOGIN";
+if result.__OK__ then
+  print "Login successful";
+else
+  error "Login failed";
+;
+
 # Now, create the null output connection, unless it's already there.
 PUT result = {
   << "outputconnection" : "" :  :
@@ -73,14 +92,17 @@ POST result = {
     << "recrawl_interval" : "86400000" :  :  >>,
     << "run_mode" : "scan once" :  :  >>,
     << "hopcount_mode" : "never delete" :  :  >>,
-    << "output_specification" : "" :  :  >>,
     << "description" : fileCrawlJobName :  :  >>,
+    << "repository_connection" : "File System" :  :  >>,
     << "document_specification" : "" :  :
       << "startpoint" : "" : "path"=fileCrawlPath : 
         << "include" : "" : "match"="*", "type"="file" :  >>,
         << "include" : "" : "match"="*", "type"="directory" :  >> >> >>,
-    << "output_connection" : "Null Output" :  :  >>,
-    << "repository_connection" : "File System" :  :  >>,
+    << "pipelinestage" : "" :  :
+      << "stage_id" : 0 :  :  >>,
+      << "stage_isoutput": "true" :  :  >>,
+      << "stage_specification" : "" :  :  >>,
+      << "stage_connectionname" : "Null Output" :  :  >> >>,
     << "priority" : "5" :  :  >>,
     << "expiration_interval" : "infinite" :  :  >> >> }
   to baseurl + "jobs";

Modified: manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/how-to-build-and-deploy.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/how-to-build-and-deploy.xml?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/how-to-build-and-deploy.xml (original)
+++ manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/how-to-build-and-deploy.xml Wed Apr  1 11:06:03 2015
@@ -1034,6 +1034,9 @@ start[.bat|.sh]
             <tr><td>org.apache.manifoldcf.login.name</td><td>No</td><td>Crawler UI login user ID (defaults to "admin")</td></tr>
             <tr><td>org.apache.manifoldcf.login.password</td><td>No</td><td>Crawler UI login user password (defaults to "admin")</td></tr>
             <tr><td>org.apache.manifoldcf.login.password.obfuscated</td><td>No</td><td>Obfuscated crawler UI login user password (defaults to "admin")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apiname</td><td>No</td><td>API login user ID (defaults to "")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apipassword</td><td>No</td><td>API login user password (defaults to "")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apipassword.obfuscated</td><td>No</td><td>Obfuscated API login user password (defaults to "")</td></tr>
             <tr><td>org.apache.manifoldcf.crawleruiwarpath</td><td>Yes, for Jetty</td><td>Location of Crawler UI war</td></tr>
             <tr><td>org.apache.manifoldcf.authorityservicewarpath</td><td>Yes, for Jetty</td><td>Location of Authority Service war</td></tr>
             <tr><td>org.apache.manifoldcf.apiservicewarpath</td><td>Yes, for Jetty</td><td>Location of API Service war</td></tr>

Modified: manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/programmatic-operation.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/programmatic-operation.xml?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/programmatic-operation.xml (original)
+++ manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/en_US/programmatic-operation.xml Wed Apr  1 11:06:03 2015
@@ -48,8 +48,8 @@
           <p>http[s]://<em>&lt;server_and_port&gt;</em>/mcf-api-service/json/<em>&lt;resource&gt;</em></p>
           <p></p>
           <p>The servlet ignores request data, except when the PUT or POST verb is used.  In that case, the request data is presumed to be a JSON object.  The servlet
-            responds either with an error response code (either 400 or 500) with an appropriate explanatory message, or with a 200 (OK), 201 (CREATED), or
-            404 (NOT FOUND) response code along with a response JSON object.</p>
+            responds either with an error response code (either 400 or 500) with an appropriate explanatory message, or with a 200 (OK), 201 (CREATED), 
+            401 (UNAUTHORIZED), or 404 (NOT FOUND) response code along with a response JSON object.</p>
           <p></p>
         </section>
         <section>
@@ -79,6 +79,7 @@
           <p></p>
           <table>
             <tr><th>Resource</th><th>Verb</th><th>What it does</th><th>Input format/query args</th><th>Output format</th></tr>
+            <tr><td>LOGIN</td><td>POST</td><td>Log in the specified user</td><td>{"userID":<em>&lt;user_name&gt;</em>, "password":<em>&lt;password&gt;</em>}</td><td>{}</td></tr>
             <tr><td>authorizationdomains</td><td>GET</td><td>List all registered authorization domains</td><td>N/A</td><td>{"authorizationdomain":[<em>&lt;list_of_authorization_domain_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
             <tr><td>outputconnectors</td><td>GET</td><td>List all registered output connectors</td><td>N/A</td><td>{"outputconnector":[<em>&lt;list_of_output_connector_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
             <tr><td>transformationconnectors</td><td>GET</td><td>List all registered transformation connectors</td><td>N/A</td><td>{"transformationconnector":[<em>&lt;list_of_transformation_connector_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>

Modified: manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/how-to-build-and-deploy.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/how-to-build-and-deploy.xml?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/how-to-build-and-deploy.xml (original)
+++ manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/how-to-build-and-deploy.xml Wed Apr  1 11:06:03 2015
@@ -157,7 +157,7 @@
           <title>Building and testing the Alfresco Webscript connector</title>
           <p></p>
           <p>The Alfresco Webscript connector is built against an open-source Alfresco Indexer client, which requires a corresponding Alfresco Indexer plugin
-                to be installed on your Alfresco instance.  This Alfresco Indexer plugin is currently available for download.  Installation of the plugin should follow the
+                to be installed on your Alfresco instance.  This Alfresco Indexer plugin is included with ManifoldCF distributions.  Installation of the plugin should follow the
                 standard Alfresco installation steps, as described <a href="http://docs.alfresco.com/4.1/tasks/amp-install.html">here</a>.
                 See <a href="https://github.com/maoo/alfresco-indexer">this page</a> for configuration details, and for the plugin itself.</p>
           <p></p>
@@ -1034,6 +1034,9 @@ start[.bat|.sh]
             <tr><td>org.apache.manifoldcf.login.name</td><td>No</td><td>Crawler UI login user ID (defaults to "admin")</td></tr>
             <tr><td>org.apache.manifoldcf.login.password</td><td>No</td><td>Crawler UI login user password (defaults to "admin")</td></tr>
             <tr><td>org.apache.manifoldcf.login.password.obfuscated</td><td>No</td><td>Obfuscated crawler UI login user password (defaults to "admin")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apiname</td><td>No</td><td>API login user ID (defaults to "")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apipassword</td><td>No</td><td>API login user password (defaults to "")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apipassword.obfuscated</td><td>No</td><td>Obfuscated API login user password (defaults to "")</td></tr>
             <tr><td>org.apache.manifoldcf.crawleruiwarpath</td><td>Yes, for Jetty</td><td>Location of Crawler UI war</td></tr>
             <tr><td>org.apache.manifoldcf.authorityservicewarpath</td><td>Yes, for Jetty</td><td>Location of Authority Service war</td></tr>
             <tr><td>org.apache.manifoldcf.apiservicewarpath</td><td>Yes, for Jetty</td><td>Location of API Service war</td></tr>

Modified: manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/programmatic-operation.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/programmatic-operation.xml?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/programmatic-operation.xml (original)
+++ manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/ja_JP/programmatic-operation.xml Wed Apr  1 11:06:03 2015
@@ -48,8 +48,8 @@
           <p>http[s]://<em>&lt;server_and_port&gt;</em>/mcf-api-service/json/<em>&lt;resource&gt;</em></p>
           <p></p>
           <p>The servlet ignores request data, except when the PUT or POST verb is used.  In that case, the request data is presumed to be a JSON object.  The servlet
-            responds either with an error response code (either 400 or 500) with an appropriate explanatory message, or with a 200 (OK), 201 (CREATED), or
-            404 (NOT FOUND) response code along with a response JSON object.</p>
+            responds either with an error response code (either 400 or 500) with an appropriate explanatory message, or with a 200 (OK), 201 (CREATED), 
+            401 (UNAUTHORIZED), or 404 (NOT FOUND) response code along with a response JSON object.</p>
           <p></p>
         </section>
         <section>
@@ -79,6 +79,7 @@
           <p></p>
           <table>
             <tr><th>Resource</th><th>Verb</th><th>What it does</th><th>Input format/query args</th><th>Output format</th></tr>
+            <tr><td>LOGIN</td><td>POST</td><td>Log in the specified user</td><td>{"userID":<em>&lt;user_name&gt;</em>, "password":<em>&lt;password&gt;</em>}</td><td>{}</td></tr>
             <tr><td>authorizationdomains</td><td>GET</td><td>List all registered authorization domains</td><td>N/A</td><td>{"authorizationdomain":[<em>&lt;list_of_authorization_domain_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
             <tr><td>outputconnectors</td><td>GET</td><td>List all registered output connectors</td><td>N/A</td><td>{"outputconnector":[<em>&lt;list_of_output_connector_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
             <tr><td>transformationconnectors</td><td>GET</td><td>List all registered transformation connectors</td><td>N/A</td><td>{"transformationconnector":[<em>&lt;list_of_transformation_connector_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>

Modified: manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/how-to-build-and-deploy.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/how-to-build-and-deploy.xml?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/how-to-build-and-deploy.xml (original)
+++ manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/how-to-build-and-deploy.xml Wed Apr  1 11:06:03 2015
@@ -157,7 +157,7 @@
           <title>Building and testing the Alfresco Webscript connector</title>
           <p></p>
           <p>The Alfresco Webscript connector is built against an open-source Alfresco Indexer client, which requires a corresponding Alfresco Indexer plugin
-                to be installed on your Alfresco instance.  This Alfresco Indexer plugin is currently available for download.  Installation of the plugin should follow the
+                to be installed on your Alfresco instance.  This Alfresco Indexer plugin is included with ManifoldCF distributions.  Installation of the plugin should follow the
                 standard Alfresco installation steps, as described <a href="http://docs.alfresco.com/4.1/tasks/amp-install.html">here</a>.
                 See <a href="https://github.com/maoo/alfresco-indexer">this page</a> for configuration details, and for the plugin itself.</p>
           <p></p>
@@ -1034,6 +1034,9 @@ start[.bat|.sh]
             <tr><td>org.apache.manifoldcf.login.name</td><td>No</td><td>Crawler UI login user ID (defaults to "admin")</td></tr>
             <tr><td>org.apache.manifoldcf.login.password</td><td>No</td><td>Crawler UI login user password (defaults to "admin")</td></tr>
             <tr><td>org.apache.manifoldcf.login.password.obfuscated</td><td>No</td><td>Obfuscated crawler UI login user password (defaults to "admin")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apiname</td><td>No</td><td>API login user ID (defaults to "")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apipassword</td><td>No</td><td>API login user password (defaults to "")</td></tr>
+            <tr><td>org.apache.manifoldcf.login.apipassword.obfuscated</td><td>No</td><td>Obfuscated API login user password (defaults to "")</td></tr>
             <tr><td>org.apache.manifoldcf.crawleruiwarpath</td><td>Yes, for Jetty</td><td>Location of Crawler UI war</td></tr>
             <tr><td>org.apache.manifoldcf.authorityservicewarpath</td><td>Yes, for Jetty</td><td>Location of Authority Service war</td></tr>
             <tr><td>org.apache.manifoldcf.apiservicewarpath</td><td>Yes, for Jetty</td><td>Location of API Service war</td></tr>

Modified: manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/programmatic-operation.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/programmatic-operation.xml?rev=1670616&r1=1670615&r2=1670616&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/programmatic-operation.xml (original)
+++ manifoldcf/branches/dev_1x/site/src/documentation/content/xdocs/zh_CN/programmatic-operation.xml Wed Apr  1 11:06:03 2015
@@ -48,8 +48,8 @@
           <p>http[s]://<em>&lt;server_and_port&gt;</em>/mcf-api-service/json/<em>&lt;resource&gt;</em></p>
           <p></p>
           <p>The servlet ignores request data, except when the PUT or POST verb is used.  In that case, the request data is presumed to be a JSON object.  The servlet
-            responds either with an error response code (either 400 or 500) with an appropriate explanatory message, or with a 200 (OK), 201 (CREATED), or
-            404 (NOT FOUND) response code along with a response JSON object.</p>
+            responds either with an error response code (either 400 or 500) with an appropriate explanatory message, or with a 200 (OK), 201 (CREATED), 
+            401 (UNAUTHORIZED), or 404 (NOT FOUND) response code along with a response JSON object.</p>
           <p></p>
         </section>
         <section>
@@ -79,6 +79,7 @@
           <p></p>
           <table>
             <tr><th>Resource</th><th>Verb</th><th>What it does</th><th>Input format/query args</th><th>Output format</th></tr>
+            <tr><td>LOGIN</td><td>POST</td><td>Log in the specified user</td><td>{"userID":<em>&lt;user_name&gt;</em>, "password":<em>&lt;password&gt;</em>}</td><td>{}</td></tr>
             <tr><td>authorizationdomains</td><td>GET</td><td>List all registered authorization domains</td><td>N/A</td><td>{"authorizationdomain":[<em>&lt;list_of_authorization_domain_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
             <tr><td>outputconnectors</td><td>GET</td><td>List all registered output connectors</td><td>N/A</td><td>{"outputconnector":[<em>&lt;list_of_output_connector_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
             <tr><td>transformationconnectors</td><td>GET</td><td>List all registered transformation connectors</td><td>N/A</td><td>{"transformationconnector":[<em>&lt;list_of_transformation_connector_objects&gt;</em>]} <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>



Mime
View raw message