[java-identity-provider] branch main updated: IDP-2486 - Adjust default UserAgent handling in IdP to be extensible

Codeberg noreply at shibboleth.net
Thu Oct 15 19:57:39 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
https://codeberg.org/Shibboleth/java-identity-provider/commit/0428d8e5a225fbd8552b57e866dab6ed1fdf1e26

The following commit(s) were added to refs/heads/main by this push:
     new 0428d8e5a IDP-2486 - Adjust default UserAgent handling in IdP to be extensible
0428d8e5a is described below

commit 0428d8e5a225fbd8552b57e866dab6ed1fdf1e26
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Thu Oct 15 14:43:12 2026 -0400

    IDP-2486 - Adjust default UserAgent handling in IdP to be extensible
    
    https://shibboleth.atlassian.net/browse/IDP-2486
    
    Add in wiring for auto-installing User-Agent for HttpClients.
    Default in existing OpenSAML and Shibboleth portions.
---
 .../net/shibboleth/idp/conf/http-client.xml        | 25 ++++++++++++++++++----
 .../net/shibboleth/spring/parser.properties        |  3 +++
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/http-client.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/http-client.xml
index 98ff56db0..82924a3be 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/http-client.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/http-client.xml
@@ -12,13 +12,30 @@
        default-init-method="initialize">
 
     <!-- These are parent beans for custom HTTP clients and resources. -->
-        
+    
+    <!-- This bean will accumulate auto-wired portions of the String to include. -->
+    <bean id="shibboleth.HttpClientUserAgent" class="net.shibboleth.shared.spring.httpclient.factory.HttpClientUserAgentFactoryBean" />
+    
+    <bean id="shibboleth.HttpClientUserAgentComponent"
+        class="net.shibboleth.shared.spring.httpclient.factory.HttpClientUserAgentComponent" abstract="true" />
+    
+    <bean parent="shibboleth.HttpClientUserAgentComponent"
+        c:_0="#{ 'Shibboleth/' + (T(net.shibboleth.saml.metadata.Version).getVersion() ?: 'Unknown') }"
+        c:_1="#{ T(org.springframework.core.Ordered).HIGHEST_PRECEDENCE }" />
+
+    <bean parent="shibboleth.HttpClientUserAgentComponent"
+        c:_0="#{ 'OpenSAML/' + (T(org.opensaml.core.Version).getVersion() ?: 'Unknown') }"
+        c:_1="#{ T(org.springframework.core.Ordered).HIGHEST_PRECEDENCE - 1 }" />
+    
     <bean id="shibboleth.HttpClientFactory" abstract="true"
-        class="net.shibboleth.spring.http.HttpClientFactoryBean" />
+        class="net.shibboleth.shared.spring.httpclient.factory.HttpClientFactoryBean"
+        p:userAgent-ref="shibboleth.HttpClientUserAgent" />
     <bean id="shibboleth.FileCachingHttpClientFactory" abstract="true"
-        class="net.shibboleth.spring.http.FileCachingHttpClientFactoryBean" />
+        class="net.shibboleth.shared.spring.httpclient.factory.FileCachingHttpClientFactoryBean"
+        p:userAgent-ref="shibboleth.HttpClientUserAgent" />
     <bean id="shibboleth.MemoryCachingHttpClientFactory" abstract="true"
-        class="net.shibboleth.spring.http.InMemoryCachingHttpClientFactoryBean" />
+        class="net.shibboleth.shared.spring.httpclient.factory.InMemoryCachingHttpClientFactoryBean"
+        p:userAgent-ref="shibboleth.HttpClientUserAgent" />
 
     <bean id="shibboleth.HTTPResource" abstract="true"
         class="net.shibboleth.spring.http.HTTPResourceFactoryBean" />
diff --git a/idp-schema/src/main/resources/META-INF/net/shibboleth/spring/parser.properties b/idp-schema/src/main/resources/META-INF/net/shibboleth/spring/parser.properties
index 574bfd498..f8a6844da 100644
--- a/idp-schema/src/main/resources/META-INF/net/shibboleth/spring/parser.properties
+++ b/idp-schema/src/main/resources/META-INF/net/shibboleth/spring/parser.properties
@@ -18,6 +18,9 @@ net.shibboleth.spring.metadata.AbstractDynamicMetadataProviderParser.ParserPool.
 net.shibboleth.spring.metadata.AbstractMetadataProviderParser.ByReferenceMetadataFilterBridge.bean = shibboleth.ByReferenceMetadataFilterBridge
 net.shibboleth.spring.metadata.AbstractMetadataProviderParser.AutoWiredNodeProcessingMetadataFilter.bean = shibboleth.AutoWiredNodeProcessingMetadataFilter
 
+net.shibboleth.spring.metadata.HTTPMetadataProviderParser.UserAgent.bean = shibboleth.HttpClientUserAgent
+net.shibboleth.spring.metadata.AbstractDynamicHTTPMetadataProviderParser.UserAgent.bean = shibboleth.HttpClientUserAgent
+
 net.shibboleth.spring.metadata.filter.SchemaValidationParser.SchemaBuilder.bean = shibboleth.SchemaBuilder
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list