Commit 4654cbbf authored by Patrick Dowler's avatar Patrick Dowler
Browse files

set max proxy cert lifetime to 30 days; changed get proxy cert to truncate...

set max proxy cert lifetime to 30 days; changed get proxy cert to truncate requested lifetime to configured max for trusted principals
parent 9d349167
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ public class ProxyServlet extends HttpServlet
                if (st2.countTokens() == 1)
                {
                    principal = principalStr.trim();
                    maxDaysValid = Float.MAX_VALUE; // no limit
                    maxDaysValid = 30.0f;
                }
                else if (st2.countTokens() == 2)
                {
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ public abstract class DelegationAction implements
                    // Time to determine the allowed lifetime of certificate
                    float maxDaysValid = trustedPrincipals.get(trustedPrinc);
                    if (maxDaysValid < daysValid)
                        throw new ResourceNotFoundException("Requested lifetime limitted to " + maxDaysValid);
                        daysValid = maxDaysValid;

                    if (daysValid == 0)
                        daysValid = maxDaysValid;
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class ProxyServletTest
        ProxyServlet testServlet = new ProxyServlet();
        ServletConfig configMock = createMock(ServletConfig.class);
        String expectedDN1 = "cn=test1,ou=hia.nrc.ca,o=grid,c=ca";
        Float expectedDaysValid1 = new Float(Float.MAX_VALUE);
        Float expectedDaysValid1 = new Float(30.0f);
        String expectedDN2 = "cn=test2,ou=hia.nrc.ca,o=grid,c=ca";
        Float expectedDaysValid2 = new Float(0.5);
        expect(configMock.getInitParameter(ProxyServlet.TRUSTED_PRINCIPALS_PARAM))