[java-plugin-shibd] branch main updated: Switch to new UserAgent parent bean.

Codeberg noreply at shibboleth.net
Tue Nov 17 17:28:36 UTC 2026


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

codeberg pushed a commit to branch main
in repository java-plugin-shibd.

View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/4d978e2a0449f2c90d1dd3522e6f38b2244fcc49

The following commit(s) were added to refs/heads/main by this push:
     new 4d978e2  Switch to new UserAgent parent bean.
4d978e2 is described below

commit 4d978e2a0449f2c90d1dd3522e6f38b2244fcc49
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue Nov 17 12:27:40 2026 -0500

    Switch to new UserAgent parent bean.
---
 .../META-INF/net.shibboleth.idp/postconfig.xml     |  2 +-
 .../impl/ConditionalHttpClientUserAgent.java       | 70 ----------------------
 2 files changed, 1 insertion(+), 71 deletions(-)

diff --git a/sp-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/sp-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
index 112c14e..6dc15e8 100644
--- a/sp-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
+++ b/sp-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -13,7 +13,7 @@
 
     default-init-method="initialize" default-destroy-method="destroy">
 
-    <bean class="net.shibboleth.sp.service.impl.ConditionalHttpClientUserAgent"
+    <bean parent="shibboleth.HttpClientUserAgentComponent"
         c:_0="#{ 'shibd/' + (T(net.shibboleth.sp.conf.Version).getVersion() ?: 'Unknown') }" />
     
     <import resource="agent-authn.xml" />
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/service/impl/ConditionalHttpClientUserAgent.java b/sp-server-impl/src/main/java/net/shibboleth/sp/service/impl/ConditionalHttpClientUserAgent.java
deleted file mode 100644
index fba4227..0000000
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/service/impl/ConditionalHttpClientUserAgent.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.sp.service.impl;
-
-import java.lang.reflect.Constructor;
-
-import javax.annotation.Nonnull;
-
-import org.springframework.beans.factory.config.AbstractFactoryBean;
-
-import net.shibboleth.shared.annotation.ParameterName;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.StringSupport;
-
-/**
- * A reflection-driven factory bean for a class appearing only in later IdP versions.
- * 
- * <p>This will be removed once the API baseline is updated.</p>
- */
-public class ConditionalHttpClientUserAgent extends AbstractFactoryBean {
-    
-    @Nonnull private Class<?> type;
-    
-    /** Value to expose if possible. */
-    @Nonnull @NotEmpty private String userAgentComponent;
-    
-    /** Constructor. */
-    public ConditionalHttpClientUserAgent(@Nonnull @NotEmpty @ParameterName(name="s") final String s) {
-        try {
-            type = Class.forName("net.shibboleth.shared.spring.httpclient.factory.HttpClientUserAgentComponent");
-        } catch (ClassNotFoundException e) {
-            type = String.class;
-        }
-        
-        userAgentComponent = Constraint.isNotNull(StringSupport.trimOrNull(s),
-                "User-Agent component cannot be null or empty");
-    }
-    
-    /** {@inheritDoc} */
-    @Override
-    @Nonnull public Class<?> getObjectType() {
-        return type;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    @Nonnull protected Object createInstance() throws Exception {
-        
-        try {
-            final Constructor<?> ctor = type.getConstructor(String.class);
-            return ctor.newInstance(userAgentComponent);
-        } catch (final NoSuchMethodException e) {
-            return new String(userAgentComponent);
-        }
-    }
-
-}
\ No newline at end of file

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


More information about the commits mailing list