[java-plugin-shibd-saml] branch main updated: Eliminate metadata service property and fix redirect URL handling.

Scott Cantor cantor.2 at osu.edu
Tue Oct 8 13:03:32 UTC 2024


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

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

View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd-saml.git;a=commit;h=1d78f49ac7222d1669ca84213fb05ada47370f32

The following commit(s) were added to refs/heads/main by this push:
     new 1d78f49  Eliminate metadata service property and fix redirect URL handling.
1d78f49 is described below

commit 1d78f49ac7222d1669ca84213fb05ada47370f32
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Oct 8 09:03:29 2024 -0400

    Eliminate metadata service property and fix redirect URL handling.
---
 .../sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java       | 9 ++++++---
 .../TestSPSAMLEnvironmentApplicationContextInitializer.java      | 1 -
 .../shibboleth/idp/module/conf/{sp => }/metadata-providers.xml   | 0
 .../src/test/resources/net/shibboleth/sp/saml-test-beans.xml     | 4 ----
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java
index 5005cb2..fe604d3 100644
--- a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java
+++ b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java
@@ -15,6 +15,7 @@
 package net.shibboleth.sp.saml.flows.saml2;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.time.Instant;
 import java.util.List;
 
@@ -440,12 +441,14 @@ public class SAML2SessionInitiatorFlowTest extends AbstractSPFlowTest {
         Assert.assertTrue(http.isstruct());
         
         final AuthnRequest authnRequest;
-        final String redirect = http.getmember("redirect").string();
+        final byte[] redirect = http.getmember("redirect").unsafe_string();
         if (redirect != null) {
-            final SAMLObject saml = decodeRedirect(redirect, input != null ? input.getmember(InitiatorConstants.STATE).string() : null);
+            final String redirectURL = new String(redirect, StandardCharsets.UTF_8);
+            final SAMLObject saml = decodeRedirect(redirectURL,
+                    input != null ? input.getmember(InitiatorConstants.STATE).string() : null);
             assert saml instanceof AuthnRequest;
             authnRequest = (AuthnRequest) saml;
-            Assert.assertTrue(redirect.startsWith(authnRequest.getDestination()));
+            Assert.assertTrue(redirectURL.startsWith(authnRequest.getDestination()));
         } else {
             final byte[] body = http.getmember("response.data").unsafe_string();
             Assert.assertNotNull(body);
diff --git a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java
index 79246d6..38161ec 100644
--- a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java
+++ b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java
@@ -43,7 +43,6 @@ public class TestSPSAMLEnvironmentApplicationContextInitializer
         final MockPropertySource mock = new MockPropertySource();
         mock.setProperty("idp.home", "classpath:/net/shibboleth/idp/module");
         mock.setProperty("idp.webflows", "classpath*:/flows");
-        mock.setProperty("idp.service.metadata.resources", "test.sp.saml.MetadataResolverResources");
         mock.setProperty("sp.service.agents.resources", "test.sp.saml.AgentResolverResources");
         mock.setProperty("sp.application.sessionInitiators", "saml2");
         mock.setProperty("sp.application.tokenConsumers", "saml2/artifact, saml2/post, saml2/post-simplesign");
diff --git a/sp-saml-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/metadata-providers.xml b/sp-saml-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/metadata-providers.xml
similarity index 100%
rename from sp-saml-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/metadata-providers.xml
rename to sp-saml-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/metadata-providers.xml
diff --git a/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml b/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml
index f9211a2..56a8c7f 100644
--- a/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml
+++ b/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml
@@ -20,10 +20,6 @@
         <value>%{idp.home}/conf/sp/saml-test-agents.xml</value>
     </util:list>
 
-    <util:list id="test.sp.saml.MetadataResolverResources">
-        <value>%{idp.home}/conf/sp/metadata-providers.xml</value>
-    </util:list>
-
     <bean id="dummy.idp.X509Certificate" class="net.shibboleth.shared.spring.security.factory.X509CertificateFactoryBean"
         p:resource="%{idp.home}/credentials/idp-signing.crt" />
 

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


More information about the commits mailing list