[java-identity-provider] branch main updated: Support multiple client IP ranges for Sauce Labs browser tests

Tom Zeller tzeller at dragonacea.biz
Mon Jun 7 22:18:32 UTC 2021


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

tzeller 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=6b523cc4a1356a1308535d2d6844589c6d48308c

The following commit(s) were added to refs/heads/main by this push:
       new  6b523cc4a Support multiple client IP ranges for Sauce Labs browser tests
6b523cc4a is described below

commit 6b523cc4a1356a1308535d2d6844589c6d48308c
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Mon Jun 7 17:18:09 2021 -0500

    Support multiple client IP ranges for Sauce Labs browser tests
---
 .../idp/test/flows/saml2/SAML2TestResponseValidator.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/SAML2TestResponseValidator.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/SAML2TestResponseValidator.java
index fdfe9486e..4abd9f590 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/SAML2TestResponseValidator.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/SAML2TestResponseValidator.java
@@ -21,6 +21,7 @@ import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -84,8 +85,8 @@ public class SAML2TestResponseValidator extends SAML2TestStatusResponseTypeValid
     @Nonnull public String subjectConfirmationMethod = SubjectConfirmation.METHOD_BEARER;
     
     /** Expected subject confirmation data address range for IPv4 addresses. Defaults to "127.0.0.1/32". */
-    @Nonnull public IPRange subjectConfirmationDataAddressRange = IPRange.parseCIDRBlock("127.0.0.1/32");
-    
+    @Nonnull public List<IPRange> subjectConfirmationDataAddressRanges = new ArrayList<>(Arrays.asList(IPRange.parseCIDRBlock("127.0.0.1/32")));
+
     /** Expected subject confirmation data address range for IPv6 addresses. Defaults to "::1/128". */
     @Nonnull public IPRange subjectConfirmationDataAddressRangeV6 = IPRange.parseCIDRBlock("::1/128");
 
@@ -434,7 +435,13 @@ public class SAML2TestResponseValidator extends SAML2TestStatusResponseTypeValid
     public void assertSubjectConfirmationData(@Nullable final SubjectConfirmationData subjectConfirmationData) {
         final InetAddress address = InetAddresses.forString(subjectConfirmationData.getAddress());
         if (address instanceof Inet4Address) {
-            Assert.assertTrue(subjectConfirmationDataAddressRange.contains(address));
+            boolean matches = false;
+            for (final IPRange subjectConfirmationDataAddressRange : subjectConfirmationDataAddressRanges) {
+                if (subjectConfirmationDataAddressRange.contains(address)) {
+                    matches = true;
+                }
+            }
+            Assert.assertTrue(matches, "SubjectConfirmationData Address does not match");
         } else if(address instanceof Inet6Address) {
             Assert.assertTrue(subjectConfirmationDataAddressRangeV6.contains(address));
         } else {

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


More information about the commits mailing list