[java-opensaml] branch main updated: IDP-2352: SOAP client wiring references old bean ID

Brent Putman putmanb at georgetown.edu
Sat Feb 1 01:07:36 UTC 2025


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

putmanb pushed a commit to branch main
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=3dbcde9feddda795308b3d496b5742a71b1ac67c

The following commit(s) were added to refs/heads/main by this push:
     new 3dbcde9fe IDP-2352: SOAP client wiring references old bean ID
3dbcde9fe is described below

commit 3dbcde9feddda795308b3d496b5742a71b1ac67c
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Fri Jan 31 20:07:33 2025 -0500

    IDP-2352: SOAP client wiring references old bean ID
    
    MessageHandlers became initializable in 5.x. So need to init the body
    handler impl that is created in code within the SAML SOAP decoders.
---
 .../decoding/impl/HttpClientResponseSOAP11Decoder.java       | 12 +++++++++++-
 .../decoding/impl/HttpClientResponseSOAP11Decoder.java       | 12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java
index d62c87f42..ead85928d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java
@@ -20,6 +20,7 @@ import javax.annotation.Nullable;
 import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.messaging.decoder.MessageDecodingException;
 import org.opensaml.saml.common.SAMLObject;
+import org.opensaml.saml.common.SAMLRuntimeException;
 import org.opensaml.saml.common.binding.BindingDescriptor;
 import org.opensaml.saml.common.binding.decoding.SAMLMessageDecoder;
 import org.opensaml.saml.common.binding.impl.SAMLSOAPDecoderBodyHandler;
@@ -28,6 +29,7 @@ import org.opensaml.saml.common.xml.SAMLConstants;
 import org.slf4j.Logger;
 
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
 /**
@@ -47,7 +49,15 @@ public class HttpClientResponseSOAP11Decoder
      * Constructor.
      */
     public HttpClientResponseSOAP11Decoder() {
-        setBodyHandler(new SAMLSOAPDecoderBodyHandler());
+        final SAMLSOAPDecoderBodyHandler bodyHandler = new SAMLSOAPDecoderBodyHandler();
+        try {
+            bodyHandler.initialize();
+        } catch (ComponentInitializationException e) {
+            // This handler init can't really fail, but we need to handle
+            // without changing the ctor signature by adding a checked exception
+            throw new SAMLRuntimeException("Error initializing SOAP decoder body handler", e);
+        }
+        setBodyHandler(bodyHandler);
         setProtocolMessageLoggerSubCategory("SAML");
     }
 
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java
index 097cb00e9..8564e469f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HttpClientResponseSOAP11Decoder.java
@@ -20,6 +20,7 @@ import javax.annotation.Nullable;
 import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.messaging.decoder.MessageDecodingException;
 import org.opensaml.saml.common.SAMLObject;
+import org.opensaml.saml.common.SAMLRuntimeException;
 import org.opensaml.saml.common.binding.BindingDescriptor;
 import org.opensaml.saml.common.binding.decoding.SAMLMessageDecoder;
 import org.opensaml.saml.common.binding.impl.SAMLSOAPDecoderBodyHandler;
@@ -28,6 +29,7 @@ import org.opensaml.saml.common.xml.SAMLConstants;
 import org.slf4j.Logger;
 
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
 /**
@@ -47,7 +49,15 @@ public class HttpClientResponseSOAP11Decoder
      * Constructor.
      */
     public HttpClientResponseSOAP11Decoder() {
-        setBodyHandler(new SAMLSOAPDecoderBodyHandler());
+        final SAMLSOAPDecoderBodyHandler bodyHandler = new SAMLSOAPDecoderBodyHandler();
+        try {
+            bodyHandler.initialize();
+        } catch (ComponentInitializationException e) {
+            // This handler init can't really fail, but we need to handle
+            // without changing the ctor signature by adding a checked exception
+            throw new SAMLRuntimeException("Error initializing SOAP decoder body handler", e);
+        }
+        setBodyHandler(bodyHandler);
         setProtocolMessageLoggerSubCategory("SAML");
     }
 

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


More information about the commits mailing list