Commit 8fcea23c authored by Patrick Dowler's avatar Patrick Dowler Committed by GitHub
Browse files

Merge pull request #14 from pdowler/master

strip quotes from DN in servlet init
parents 966ea7a5 50f7157f
......@@ -14,7 +14,7 @@ sourceCompatibility = 1.7
group = 'org.opencadc'
version = '1.1.1'
version = '1.1.2'
dependencies {
compile 'log4j:log4j:1.+'
......
......@@ -116,7 +116,8 @@ public class CadcDelegationServlet extends DelegationServlet
String[] dns = suDNStr.split("\n");
for (String dn : dns)
{
X500Principal su = new X500Principal(dn);
String sp = dn.replaceAll("\"", "").trim();
X500Principal su = new X500Principal(sp);
suDNs.add(su);
LOGGER.info("SU: " + su.getName());
}
......
......@@ -154,8 +154,8 @@ public class ProxyServlet extends HttpServlet
String principalStr = st.nextToken();
StringTokenizer st2 = new StringTokenizer(principalStr, ":",
false);
final String principal; // the principal of the trusted client
final Float maxDaysValid; // maximum lifetime of the returned proxy
String principal; // the principal of the trusted client
Float maxDaysValid; // maximum lifetime of the returned proxy
if (st2.countTokens() == 1)
{
......@@ -179,10 +179,12 @@ public class ProxyServlet extends HttpServlet
"Cannot parse trusted principal from servlet " +
"config: " + principalStr);
}
LOGGER.info("trusted: " + principal + " , max days valid: "
+ maxDaysValid);
trustedPrincipals.put(new X500Principal(principal),
maxDaysValid);
if (principal != null)
{
principal = principal.replaceAll("\"", "");
LOGGER.info("trusted: " + principal + " , max days valid: " + maxDaysValid);
trustedPrincipals.put(new X500Principal(principal), maxDaysValid);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment