From c660cd7255c1a6885fabcf6d8b7898f75119fbc0 Mon Sep 17 00:00:00 2001
From: Sara Bertocco <bertocco@oats.inaf.it>
Date: Fri, 25 Nov 2016 15:46:56 +0100
Subject: [PATCH] Fix to support TERENA certificates. Javadoc added

---
 .../ac/server/web/ResetPasswordServlet.java   | 28 +++++++++++++++++++
 .../ac/server/web/UserRequestServlet.java     | 28 +++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/ResetPasswordServlet.java b/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/ResetPasswordServlet.java
index 86cb2900..736874c0 100644
--- a/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/ResetPasswordServlet.java
+++ b/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/ResetPasswordServlet.java
@@ -122,6 +122,34 @@ public class ResetPasswordServlet extends HttpServlet
     List<Subject> privilegedSubjects;
     UserPersistence userPersistence;
 
+    /**
+     * Servlet initialization method.
+     * 
+     * <p>
+     * Receives the servlet configuration object and initializes UserPersistence 
+     * using input parameters read from it. Users who do augment
+     * subject calls are constructed by taking the principals out of the ServletConfig 
+     * input parameter.
+     * 
+     * <p>
+     * The ResetPasswordServlet configuration in the web deployment descriptor file 
+     * <code>web.xml</code> must have two input parameters:
+     * <ul>
+     * <li><code>ca.nrc.cadc.ac.server.web.ResetPasswordServlet.PrivilegedX500Principals</code>
+     * is a list of trusted administrators DNs. It is a multi-line list with
+     * line breaks between the trusted DNs and each DN eclosed in double quotes.
+     * <li><code>ca.nrc.cadc.ac.server.web.ResetPasswordServlet.PrivilegedHttpPrincipals</code>
+     * is a list of space separated userids (HTTP identities) corresponding 
+     * to the previous DNs.
+     * </ul>
+     * The two lists of principal names must be of the same
+     * length and correspond to each other in order.
+     * 
+     * @param config           The servlet configuration object.
+     * @param response         The HTTP Response.
+     * 
+     * @throws javax.servlet.ServletException   For general Servlet exceptions.
+     */
     @Override
     public void init(final ServletConfig config) throws ServletException
     {
diff --git a/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/UserRequestServlet.java b/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/UserRequestServlet.java
index febe8174..62f087fd 100644
--- a/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/UserRequestServlet.java
+++ b/cadc-access-control-server/src/main/java/ca/nrc/cadc/ac/server/web/UserRequestServlet.java
@@ -110,6 +110,34 @@ public class UserRequestServlet extends HttpServlet
 
     private UserPersistence userPersistence;
 
+    /**
+     * Servlet initialization method.
+     * 
+     * <p>
+     * Receives the servlet configuration object and initializes UserPersistence 
+     * using input parameters read from it. Users who do augment
+     * subject calls are constructed by taking the principals out of the ServletConfig
+     * input parameter.
+     * 
+     * <p>
+     * The UserRequestServlet in the web deployment descriptor file 
+     * <code>web.xml</code> must have two input parameters:
+     * <ul>
+     * <li><code>ca.nrc.cadc.ac.server.web.UserRequestServlet.PrivilegedX500Principals</code>
+     * is a list of trusted administrators DNs. It is a multi-line list with
+     * line breaks between the trusted DNs and each DN eclosed in double quotes.
+     * <li><code>ca.nrc.cadc.ac.server.web.UserRequestServlet.PrivilegedHttpPrincipals</code>
+     * is a list of space separated userids (HTTP identities) corresponding 
+     * to the previous DNs.
+     * </ul>
+     * The two lists of principal names must be of the same
+     * length and correspond to each other in order.
+     * 
+     * @param config           The servlet configuration object.
+     * @param response         The HTTP Response.
+     * 
+     * @throws javax.servlet.ServletException   For general Servlet exceptions.
+     */
     @Override
     public void init(ServletConfig config) throws ServletException
     {
-- 
GitLab