Author: markt Date: Thu Apr 14 20:50:40 2016 New Revision: 1739192 URL: http://svn.apache.org/viewvc?rev=1739192&view=rev Log: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59284 Allow the Tomcat provided JASPIC SimpleServerAuthConfig to pick up module confiuration properties from either the property set passed to its constructor or from the properties passed in the call to getAuthContext. Based on a patch by Thomas Maslen.
Added: tomcat/tc8.5.x/trunk/test/org/apache/catalina/authenticator/jaspic/TestSimpleServerAuthConfig.java - copied unchanged from r1739191, tomcat/trunk/test/org/apache/catalina/authenticator/jaspic/TestSimpleServerAuthConfig.java tomcat/tc8.5.x/trunk/test/org/apache/catalina/authenticator/jaspic/TesterMessageInfo.java - copied unchanged from r1739191, tomcat/trunk/test/org/apache/catalina/authenticator/jaspic/TesterMessageInfo.java tomcat/tc8.5.x/trunk/test/org/apache/catalina/authenticator/jaspic/TesterServerAuthModuleA.java - copied unchanged from r1739191, tomcat/trunk/test/org/apache/catalina/authenticator/jaspic/TesterServerAuthModuleA.java Modified: tomcat/tc8.5.x/trunk/ (props changed) tomcat/tc8.5.x/trunk/java/org/apache/catalina/authenticator/jaspic/SimpleServerAuthConfig.java tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc8.5.x/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Apr 14 20:50:40 2016 @@ -1 +1 @@ -/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176 +/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176,1739191 Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/authenticator/jaspic/SimpleServerAuthConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/authenticator/jaspic/SimpleServerAuthConfig.java?rev=1739192&r1=1739191&r2=1739192&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/catalina/authenticator/jaspic/SimpleServerAuthConfig.java (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/authenticator/jaspic/SimpleServerAuthConfig.java Thu Apr 14 20:50:40 2016 @@ -102,16 +102,14 @@ public class SimpleServerAuthConfig impl if (this.properties != null) { mergedProperties.putAll(this.properties); } - if (properties == null) { - throw new AuthException(sm.getString("simpleServerAuthConfig.noModules")); - } else { + if (properties != null) { mergedProperties.putAll(properties); } List<ServerAuthModule> modules = new ArrayList<>(); int moduleIndex = 1; String key = SERVER_AUTH_MODULE_KEY_PREFIX + moduleIndex; - String moduleClassName = (String) properties.get(key); + String moduleClassName = mergedProperties.get(key); while (moduleClassName != null) { try { Class<?> clazz = Class.forName(moduleClassName); @@ -127,7 +125,7 @@ public class SimpleServerAuthConfig impl // Look for the next module moduleIndex++; key = SERVER_AUTH_MODULE_KEY_PREFIX + moduleIndex; - moduleClassName = (String) properties.get(key); + moduleClassName = mergedProperties.get(key); } if (modules.size() == 0) { Modified: tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml?rev=1739192&r1=1739191&r2=1739192&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Thu Apr 14 20:50:40 2016 @@ -128,6 +128,13 @@ express a preference, use the server order to determine the preferred format. Based on a patch by gmokki. (markt) </add> + <fix> + <bug>59284</bug>: Allow the Tomcat provided JASPIC + <code>SimpleServerAuthConfig</code> to pick up module confiuration + properties from either the property set passed to its constructor or + from the properties passed in the call to <code>getAuthContext</code>. + Based on a patch by Thomas Maslen. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org