[java-identity-provider] 07/09: IDP-1961 Allow custom HttpClient for IdP update (e.g. HTTP Proxy)

Rod Widdowson rdw at steadingsoftware.com
Tue May 23 08:23:15 UTC 2023


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

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

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=44738a425867c87692f0c5cf6499a5080d2dd0aa

commit 44738a425867c87692f0c5cf6499a5080d2dd0aa
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun May 21 15:53:07 2023 +0100

    IDP-1961 Allow custom HttpClient for IdP update (e.g. HTTP Proxy)
    
    https://shibboleth.atlassian.net/browse/IDP-1961
---
 .../net/shibboleth/idp/installer/impl/CurrentInstallState.java |  3 ---
 .../net/shibboleth/idp/installer/impl/IdPInstallerCLI.java     | 10 ++++++++++
 .../java/net/shibboleth/idp/installer/TestInstallerCLI.java    |  3 ++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
index 1415a2cdc..97d832945 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
@@ -17,10 +17,8 @@
 
 package net.shibboleth.idp.installer.impl;
 
-import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
@@ -50,7 +48,6 @@ import org.slf4j.Logger;
 import net.shibboleth.idp.installer.InstallerSupport;
 import net.shibboleth.idp.module.IdPModule;
 import net.shibboleth.idp.module.ModuleContext;
-import net.shibboleth.idp.spring.IdPPropertiesApplicationContextInitializer;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPInstallerCLI.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPInstallerCLI.java
index 71a94e7ab..33c7179b9 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPInstallerCLI.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPInstallerCLI.java
@@ -19,6 +19,7 @@ package net.shibboleth.idp.installer.impl;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.util.List;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -28,9 +29,12 @@ import org.apache.tools.ant.BuildException;
 import org.opensaml.security.httpclient.HttpClientSecurityParameters;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
 
 import net.shibboleth.idp.Version;
 import net.shibboleth.shared.cli.AbstractCommandLine;
+import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
@@ -69,6 +73,12 @@ public class IdPInstallerCLI extends AbstractCommandLine<IdPInstallerArguments>
         return localLog;
     }
 
+    /** {@inheritDoc} */
+    @Nonnull protected List<Resource> getAdditionalSpringResources() {
+        return CollectionSupport.singletonList(
+               new ClassPathResource("net/shibboleth/idp/conf/http-client.xml"));
+    }
+
     /** {@inheritDoc} */
     protected int doRun(@Nonnull final IdPInstallerArguments args) {
 
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
index 43b40c59b..b0b28f5ac 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
@@ -26,7 +26,7 @@ import net.shibboleth.idp.installer.impl.InstallerProperties;
  */
 public class TestInstallerCLI {
 
-    @Test(enabled = false)
+    @Test(enabled = true)
     public void install() {
 
         System.setProperty(InstallerProperties.KEY_STORE_PASSWORD, "p1");
@@ -39,6 +39,7 @@ public class TestInstallerCLI {
                 "--home", "classpath:/net/shibboleth/idp/module",
                 "-t",
                 "h:\\downloads\\idp",
+                "-hc", "shibboleth.InternalHttpClient"
                });
     }
 }

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


More information about the commits mailing list