You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2013/06/19 14:10:13 UTC

svn commit: r1494575 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main: java/org/apache/uima/ducc/ws/server/DuccHandler.java java/org/apache/uima/ducc/ws/server/DuccHandlerUserAuthentication.java webapp/root/js/ducc.js webapp/root/login.jsp

Author: degenaro
Date: Wed Jun 19 12:10:13 2013
New Revision: 1494575

URL: http://svn.apache.org/r1494575
Log:
UIMA-2984 DUCC webserver (WS) improvement for the case of "default" authenticator, which does not check password

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerUserAuthentication.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/login.jsp

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java?rev=1494575&r1=1494574&r2=1494575&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java Wed Jun 19 12:10:13 2013
@@ -110,6 +110,7 @@ public class DuccHandler extends DuccAbs
 	private String duccLogoutLink					= duccContext+"/logout-link";
 	private String duccAuthenticationStatus 		= duccContext+"/authentication-status";
 	private String duccAuthenticatorVersion 		= duccContext+"/authenticator-version";
+	private String duccAuthenticatorPasswordChecked	= duccContext+"/authenticator-password-checked";
 	
 	private String duccJobIdData					= duccContext+"/job-id-data";
 	private String duccJobWorkitemsCountData		= duccContext+"/job-workitems-count-data";
@@ -285,6 +286,22 @@ public class DuccHandler extends DuccAbs
 		duccLogger.trace(methodName, null, messages.fetch("exit"));
 	}	
 	
+	private void handleDuccServletduccAuthenticatorPasswordChecked(String target,Request baseRequest,HttpServletRequest request,HttpServletResponse response) 
+	throws IOException, ServletException
+	{
+		String methodName = "handleDuccServletduccAuthenticatorPasswordChecked";
+		duccLogger.trace(methodName, null, messages.fetch("enter"));
+		StringBuffer sb = new StringBuffer();
+		if(iAuthenticationManager.isPasswordChecked()) {
+			sb.append("<input type=\"password\" name=\"password\"/>");
+		}
+		else {
+			sb.append("<input type=\"password\" name=\"password\" disabled=disabled title=\"Authenticator does not check password\"/>");
+		}
+		response.getWriter().println(sb);
+		duccLogger.trace(methodName, null, messages.fetch("exit"));
+	}	
+	
 	/*
 	private void handleDuccServletJobSubmitForm(String target,Request baseRequest,HttpServletRequest request,HttpServletResponse response) 
 	throws IOException, ServletException
@@ -3414,6 +3431,10 @@ public class DuccHandler extends DuccAbs
 				handleDuccServletAuthenticatorVersion(target, baseRequest, request, response);
 				//DuccWebUtil.noCache(response);
 			}
+			else if(reqURI.startsWith(duccAuthenticatorPasswordChecked)) {
+				handleDuccServletduccAuthenticatorPasswordChecked(target, baseRequest, request, response);
+				//DuccWebUtil.noCache(response);
+			}
 			else if(reqURI.startsWith(duccLoginLink)) {
 				handleDuccServletLoginLink(target, baseRequest, request, response);
 			}

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerUserAuthentication.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerUserAuthentication.java?rev=1494575&r1=1494574&r2=1494575&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerUserAuthentication.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerUserAuthentication.java Wed Jun 19 12:10:13 2013
@@ -125,7 +125,7 @@ public class DuccHandlerUserAuthenticati
 			duccLogger.info(methodName, jobid, messages.fetch("login ")+userId+" "+messages.fetch("failed"));
 			sb.append("failure");
 		}
-		else if((password == null) || (password.trim().length() == 0)) {
+		else if(iAuthenticationManager.isPasswordChecked() && (((password == null) || (password.trim().length() == 0)))) {
 			duccLogger.info(methodName, jobid, messages.fetch("login ")+userId+" "+messages.fetch("failed"));
 			sb.append("failure");
 		}

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js?rev=1494575&r1=1494574&r2=1494575&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js Wed Jun 19 12:10:13 2013
@@ -120,6 +120,23 @@ function ducc_version()
 	}
 }
 
+function ducc_password_checked()
+{
+    try {
+        $.ajax(
+        {
+            url : "/ducc-servlet/authenticator-password-checked",
+            success : function (data) 
+            {
+                $("#password_checked_area").html(data);
+            }
+        });
+    }
+    catch(err) {
+        ducc_error("ducc_password_checked",err);
+    }
+}
+
 function ducc_authenticator_version()
 {
 	try {
@@ -1560,6 +1577,7 @@ function ducc_init(type)
 		if(type == "authentication-login") {
 			ducc_init_common();
 			ducc_load_common();
+			ducc_password_checked();
 			$(document).keypress(function(e) {
   			if(e.which == 13) {
     			ducc_submit_login();

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/login.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/login.jsp?rev=1494575&r1=1494574&r2=1494575&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/login.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/login.jsp Wed Jun 19 12:10:13 2013
@@ -110,7 +110,10 @@ under the License.
         <tr>
         <td align="right">password
         <td align="right">
-        <td align="left" ><input type="password" name="password" />
+        <td align="left" >
+          <span id="password_checked_area">
+            <input type="password" name="password" disabled=disabled/>
+          </span>
         <tr>
         <td align="right">
         <td align="right">