[java-shib-shared] branch main updated: IDP-2117 Make the Plugin Installer understand HttpClientSecurityParameters

Rod Widdowson rdw at steadingsoftware.com
Sun May 28 14:46:41 UTC 2023


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

rdw pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=ca940cfffc6356745d0a6c424d9c10f1a93a6411

The following commit(s) were added to refs/heads/main by this push:
     new ca940cff IDP-2117 Make the Plugin Installer understand HttpClientSecurityParameters
ca940cff is described below

commit ca940cfffc6356745d0a6c424d9c10f1a93a6411
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun May 28 15:45:26 2023 +0100

    IDP-2117 Make the Plugin Installer understand HttpClientSecurityParameters
    
    https://shibboleth.atlassian.net/browse/IDP-2117
    
    Allowin creation of child HTTPResource objects with an associated
    HttpClientContextHandler
---
 .../shared/spring/httpclient/resource/HTTPResource.java  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/shib-networking-spring/src/main/java/net/shibboleth/shared/spring/httpclient/resource/HTTPResource.java b/shib-networking-spring/src/main/java/net/shibboleth/shared/spring/httpclient/resource/HTTPResource.java
index 1a256727..ea5bfa3f 100644
--- a/shib-networking-spring/src/main/java/net/shibboleth/shared/spring/httpclient/resource/HTTPResource.java
+++ b/shib-networking-spring/src/main/java/net/shibboleth/shared/spring/httpclient/resource/HTTPResource.java
@@ -346,6 +346,19 @@ public class HTTPResource extends AbstractIdentifiedInitializableComponent imple
 
     /** {@inheritDoc} Based on {@link org.springframework.core.io.UrlResource}. */
     @Override @Nonnull public HTTPResource createRelative(@Nonnull final String relativePath) throws IOException {
+        return createRelative(relativePath, null);
+    }
+        
+    /** Create a resource relative to us, but use the supplied handler.
+     *
+     * @param relativePath The path to create
+     * @param handler (optional) the handler
+     * @return the resource
+     * @throws IOException if we cannot set things up correctly
+     * @since 9.0.0
+     */
+     @Nonnull public HTTPResource createRelative(@Nonnull final String relativePath, @Nullable final HttpClientContextHandler handler) throws IOException {
+
         final String path;
         if (relativePath.startsWith("/")) {
             path = relativePath.substring(1);
@@ -353,6 +366,9 @@ public class HTTPResource extends AbstractIdentifiedInitializableComponent imple
             path = relativePath;
         }
         final HTTPResource result = new HTTPResource(httpClient, new URL(resourceURL, path));
+        if (handler!=null) {
+            result.setHttpClientContextHandler(handler);
+        }
         try {
             result.setId(getId()+"_"+relativePath);
             result.initialize();

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


More information about the commits mailing list