[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/system/conf/global-system.xml idp-profile-spri...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Dec 15 14:00:15 EST 2014
Author: putmanb
Date: Mon Dec 15 14:00:15 2014
New Revision: 7102
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7102&view=rev
Log:
Checkpoint some work on HTTP metadata provider parsers. Add in schema and parser support for configuring HttpClient caching right in the custom schema.
Unit tests pending.
Added:
trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/InMemoryCachingHttpClientFactoryBean.java (with props)
Modified:
trunk/idp-conf/src/main/resources/system/conf/global-system.xml
trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractDynamicHTTPMetadataProviderParser.java
trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/HTTPMetadataProviderParser.java
trunk/idp-schema/src/main/resources/schema/shibboleth-metadata.xsd
Modified: trunk/idp-conf/src/main/resources/system/conf/global-system.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/conf/global-system.xml?rev=7102&r1=7101&r2=7102&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/conf/global-system.xml (original)
+++ trunk/idp-conf/src/main/resources/system/conf/global-system.xml Mon Dec 15 14:00:15 2014
@@ -233,5 +233,21 @@
<bean id="shibboleth.KeyInfoCredentialResolver"
class="org.opensaml.xmlsec.config.DefaultSecurityConfigurationBootstrap"
factory-method="buildBasicInlineKeyInfoCredentialResolver" />
+
+ <!-- These are the common caching HttpClients wired to by multiple components, such as HTTPResources. -->
+ <!-- TODO expose other properties by default? -->
+ <!-- TODO toggle to build only one or the other, etc? -->
+ <!--
+ <bean id="shibboleth.FileCachingHttpClient"
+ class="net.shibboleth.idp.profile.spring.relyingparty.metadata.FileCachingHttpClientFactoryBean"
+ p:cacheDirectory="%{idp.httpclient.filecaching.cacheDirectory}"
+ p:maxCacheEntries="%{idp.httpclient.filecaching.maxCacheEntries}"
+ p:maxCacheEntrySize="%{idp.httpclient.filecaching.maxCacheEntrySize}" />
+
+ <bean id="shibboleth.MemoryCachingHttpClient"
+ class="net.shibboleth.idp.profile.spring.relyingparty.metadata.InMemoryCachingHttpClientFactoryBean"
+ p:maxCacheEntries="%{idp.httpclient.memorycaching.maxCacheEntries}"
+ p:maxCacheEntrySize="%{idp.httpclient.memorycaching.maxCacheEntrySize}" />
+ -->
</beans>
Modified: trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractDynamicHTTPMetadataProviderParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractDynamicHTTPMetadataProviderParser.java?rev=7102&r1=7101&r2=7102&view=diff
==============================================================================
--- trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractDynamicHTTPMetadataProviderParser.java (original)
+++ trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractDynamicHTTPMetadataProviderParser.java Mon Dec 15 14:00:15 2014
@@ -20,12 +20,16 @@
import java.util.List;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
import net.shibboleth.utilities.java.support.xml.XMLConstants;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
+import org.springframework.beans.factory.parsing.Location;
+import org.springframework.beans.factory.parsing.Problem;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
@@ -40,6 +44,9 @@
/** BASIC auth password. */
private static final String BASIC_AUTH_PASSWORD = "basicAuthPassword";
+
+ /** Default caching type . */
+ private static final String DEFAULT_CACHING = "memory";
/** Logger. */
private final Logger log = LoggerFactory.getLogger(AbstractDynamicHTTPMetadataProviderParser.class);
@@ -60,7 +67,7 @@
+ "disregardSslCertificate, proxyHost, proxyPort, proxyUser and proxyPassword");
}
} else {
- builder.addConstructorArgValue(buildHttpClient(element));
+ builder.addConstructorArgValue(buildHttpClient(element, parserContext));
}
if (element.hasAttributeNS(null, "credentialsProviderRef")) {
@@ -88,39 +95,79 @@
* Build the definition of the HTTPClientBuilder which contains all our configuration.
*
[... 291 lines stripped ...]
More information about the commits
mailing list