Skip to content
Snippets Groups Projects
Commit 7e9bd810 authored by Sara Bertocco's avatar Sara Bertocco
Browse files

For patched pull request with javadoc

parent af3a68fb
No related branches found
No related tags found
No related merge requests found
...@@ -130,25 +130,22 @@ public class ResetPasswordServlet extends HttpServlet ...@@ -130,25 +130,22 @@ public class ResetPasswordServlet extends HttpServlet
* using input parameters read from it. Users who do augment * using input parameters read from it. Users who do augment
* subject calls are constructed by taking the principals out of the ServletConfig * subject calls are constructed by taking the principals out of the ServletConfig
* input parameter. * input parameter.
* </p>
* *
* <p> * <p>
* The ResetPasswordServlet configuration in the web deployment descriptor file * The ResetPasswordServlet configuration in the web deployment descriptor file
* <code>web.xml</code> must have two input parameters: * <code>web.xml</code> must have two input parameters:
* <ul> * <ul>
* <li><code>ca.nrc.cadc.ac.server.web.ResetPasswordServlet.PrivilegedX500Principals</code> * <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 * is a list of trusted administrators DNs. Each DN must be enclosed in double quotes.
* line breaks between the trusted DNs and each DN eclosed in double quotes.</li> * The list can be multi-line for readability.</li>
* <li><code>ca.nrc.cadc.ac.server.web.ResetPasswordServlet.PrivilegedHttpPrincipals</code> * <li><code>ca.nrc.cadc.ac.server.web.ResetPasswordServlet.PrivilegedHttpPrincipals</code>
* is a list of space separated userids (HTTP identities) corresponding * is a list of space separated userids (HTTP identities), enclosed in double quotes,
* to the previous DNs.</li> * corresponding to the previous DNs.</li>
* </ul> * </ul>
* The two lists of principal names must be of the same * The two lists of principal names must be of the same
* length and correspond to each other in order. * length and correspond to each other in order.
* </p>
* *
* @param config The servlet configuration object. * @param config The servlet configuration object.
* @param response The HTTP Response.
* *
* @throws javax.servlet.ServletException For general Servlet exceptions. * @throws javax.servlet.ServletException For general Servlet exceptions.
*/ */
...@@ -205,7 +202,7 @@ public class ResetPasswordServlet extends HttpServlet ...@@ -205,7 +202,7 @@ public class ResetPasswordServlet extends HttpServlet
log.warn("No Privileged users configured."); log.warn("No Privileged users configured.");
} }
PluginFactory pluginFactory = new PluginFactory(); PluginFactory pluginFactory = getPluginFactory();
userPersistence = pluginFactory.createUserPersistence(); userPersistence = pluginFactory.createUserPersistence();
} }
catch (Throwable t) catch (Throwable t)
...@@ -215,6 +212,13 @@ public class ResetPasswordServlet extends HttpServlet ...@@ -215,6 +212,13 @@ public class ResetPasswordServlet extends HttpServlet
} }
} }
protected PluginFactory getPluginFactory()
{
return new PluginFactory();
}
protected boolean isPrivilegedSubject(final HttpServletRequest request) protected boolean isPrivilegedSubject(final HttpServletRequest request)
{ {
if (privilegedSubjects == null || privilegedSubjects.isEmpty()) if (privilegedSubjects == null || privilegedSubjects.isEmpty())
......
...@@ -118,25 +118,22 @@ public class UserRequestServlet extends HttpServlet ...@@ -118,25 +118,22 @@ public class UserRequestServlet extends HttpServlet
* using input parameters read from it. Users who do augment * using input parameters read from it. Users who do augment
* subject calls are constructed by taking the principals out of the ServletConfig * subject calls are constructed by taking the principals out of the ServletConfig
* input parameter. * input parameter.
* </p>
* *
* <p> * <p>
* The UserRequestServlet in the web deployment descriptor file * The UserRequestServlet configuration in the web deployment descriptor file
* <code>web.xml</code> must have two input parameters: * <code>web.xml</code> must have two input parameters:
* <ul> * <ul>
* <li><code>ca.nrc.cadc.ac.server.web.UserRequestServlet.PrivilegedX500Principals</code> * <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 * is a list of trusted administrators DNs. Each DN must be enclosed in double quotes.
* line breaks between the trusted DNs and each DN eclosed in double quotes.</li> * The list can be multi-line for readability.</li>
* <li><code>ca.nrc.cadc.ac.server.web.UserRequestServlet.PrivilegedHttpPrincipals</code> * <li><code>ca.nrc.cadc.ac.server.web.UserRequestServlet.PrivilegedHttpPrincipals</code>
* is a list of space separated userids (HTTP identities) corresponding * is a list of space separated userids (HTTP identities), enclosed in double quotes,
* to the previous DNs.</li> * corresponding to the previous DNs.</li>
* </ul> * </ul>
* The two lists of principal names must be of the same * The two lists of principal names must be of the same
* length and correspond to each other in order. * length and correspond to each other in order.
* </p>
* *
* @param config The servlet configuration object. * @param config The servlet configuration object.
* @param response The HTTP Response.
* *
* @throws javax.servlet.ServletException For general Servlet exceptions. * @throws javax.servlet.ServletException For general Servlet exceptions.
*/ */
...@@ -160,7 +157,6 @@ public class UserRequestServlet extends HttpServlet ...@@ -160,7 +157,6 @@ public class UserRequestServlet extends HttpServlet
Pattern pattern = Pattern.compile("([^\"]\\S*|\".+?\")\\s*"); Pattern pattern = Pattern.compile("([^\"]\\S*|\".+?\")\\s*");
Matcher x500Matcher = pattern.matcher(x500Users); Matcher x500Matcher = pattern.matcher(x500Users);
Matcher httpMatcher = pattern.matcher(httpUsers); Matcher httpMatcher = pattern.matcher(httpUsers);
while (x500Matcher.find()) while (x500Matcher.find())
{ {
String next = x500Matcher.group(1); String next = x500Matcher.group(1);
...@@ -193,7 +189,7 @@ public class UserRequestServlet extends HttpServlet ...@@ -193,7 +189,7 @@ public class UserRequestServlet extends HttpServlet
log.warn("No Privileged users configured."); log.warn("No Privileged users configured.");
} }
PluginFactory pluginFactory = new PluginFactory(); PluginFactory pluginFactory = getPluginFactory();
userPersistence = pluginFactory.createUserPersistence(); userPersistence = pluginFactory.createUserPersistence();
} }
catch (Throwable t) catch (Throwable t)
...@@ -203,6 +199,12 @@ public class UserRequestServlet extends HttpServlet ...@@ -203,6 +199,12 @@ public class UserRequestServlet extends HttpServlet
} }
} }
protected PluginFactory getPluginFactory()
{
return new PluginFactory();
}
/** /**
* Create a UserAction and run the action safely. * Create a UserAction and run the action safely.
*/ */
......
...@@ -118,25 +118,22 @@ public class UserServlet extends HttpServlet ...@@ -118,25 +118,22 @@ public class UserServlet extends HttpServlet
* using input parameters read from it. Users who do augment * using input parameters read from it. Users who do augment
* subject calls are constructed by taking the principals out of the ServletConfig * subject calls are constructed by taking the principals out of the ServletConfig
* input parameter. * input parameter.
* </p>
* *
* <p> * <p>
* The UserServlet configuration in the web deployment descriptor file * The UserServlet configuration in the web deployment descriptor file
* <code>web.xml</code> must have two input parameters: * <code>web.xml</code> must have two input parameters:
* <ul> * <ul>
* <li><code>ca.nrc.cadc.ac.server.web.UserServlet.PrivilegedX500Principals</code> * <li><code>ca.nrc.cadc.ac.server.web.UserServlet.PrivilegedX500Principals</code>
* is a list of trusted administrators DNs. It is a multi-line list with * is a list of trusted administrators DNs. Each DN must be enclosed in double quotes.
* line breaks between the trusted DNs and each DN eclosed in double quotes.</li> * The list can be multi-line for readability.</li>
* <li><code>ca.nrc.cadc.ac.server.web.UserServlet.PrivilegedHttpPrincipals</code> * <li><code>ca.nrc.cadc.ac.server.web.UserServlet.PrivilegedHttpPrincipals</code>
* is a list of space separated userids (HTTP identities) corresponding * is a list of space separated userids (HTTP identities), enclosed in double quotes,
* to the previous DNs.</li> * corresponding to the previous DNs.</li>
* </ul> * </ul>
* The two lists of principal names must be of the same * The two lists of principal names must be of the same
* length and correspond to each other in order. * length and correspond to each other in order.
* </p>
* *
* @param config The servlet configuration object. * @param config The servlet configuration object.
* @param response The HTTP Response.
* *
* @throws javax.servlet.ServletException For general Servlet exceptions. * @throws javax.servlet.ServletException For general Servlet exceptions.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment