[java-idp-integration-tests] branch main updated: Work on OIDC tests

Tom Zeller tzeller at dragonacea.biz
Thu Feb 29 17:00:13 UTC 2024


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

tzeller pushed a commit to branch main
in repository java-idp-integration-tests.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=e16336652afb801af20609e5a5009d0af23b070b

The following commit(s) were added to refs/heads/main by this push:
     new e163366  Work on OIDC tests
e163366 is described below

commit e16336652afb801af20609e5a5009d0af23b070b
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Thu Feb 29 11:00:00 2024 -0600

    Work on OIDC tests
    
    Fix building Docker images
    
    Add more parameters to docker-compose.yml
    
    Improve handling IdP hostname
    
    https://shibboleth.atlassian.net/browse/IDP-2243
---
 src/test/docker/shib-tests-rp/docker-compose.yml         |  5 +++--
 .../idp/integration/tests/BaseIntegrationTest.java       | 12 ++++++------
 .../shibboleth/idp/integration/tests/oidc/OIDCTest.java  | 16 ++++++----------
 .../idp/integration/tests/oidc/RPContainer.java          |  5 +----
 4 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/src/test/docker/shib-tests-rp/docker-compose.yml b/src/test/docker/shib-tests-rp/docker-compose.yml
index 1478714..0a491cc 100644
--- a/src/test/docker/shib-tests-rp/docker-compose.yml
+++ b/src/test/docker/shib-tests-rp/docker-compose.yml
@@ -17,12 +17,13 @@ services:
       - OIDCRedirectURI=${OIDCRedirectURI:-/redirect_uri}
     extra_hosts:
       - "idp.tests.shibboleth.net:host-gateway"
+    hostname: ${ServerName:-rp.tests.shibboleth.net}
     ports:
       - "40080:80"
       - "40443:443"
     volumes:
-      - ./etc/pki/tls/certs/fullchain.cer:/etc/pki/tls/certs/localhost.crt
-      - ./etc/pki/tls/private/tests.shibboleth.net.key:/etc/pki/tls/private/localhost.key
+      - ${tlsCert:-./etc/pki/tls/certs/fullchain.cer}:/etc/pki/tls/certs/localhost.crt
+      - ${tlsKey:-./etc/pki/tls/private/tests.shibboleth.net.key}:/etc/pki/tls/private/localhost.key
       - ./etc/httpd/conf.modules.d/10-auth_openidc.conf:/etc/httpd/conf.modules.d/10-auth_openidc.conf
 
 networks:
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
index 0702a20..1fa764e 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
@@ -880,18 +880,18 @@ public abstract class BaseIntegrationTest {
 
         // Access control from non-localhost.
 
-        // Add public server addresses if not localhost
-        if (address != "localhost") {
+        // Add public server addresses if not localhost or domain name
+        if (!address.matches(".*\\w.*")) {
             clientIPRanges.add(address + "/32");
         }
-        if (secureAddress != "localhost") {
+        if (!secureAddress.matches(".*\\w.*")) {
             clientIPRanges.add(secureAddress + "/32");
         }
-        // Add private server addresses if not localhost
-        if (privateAddress != "localhost") {
+        // Add private server addresses if not localhost or domain name
+        if (!privateAddress.matches(".*\\w.*")) {
             clientIPRanges.add(privateAddress + "/32");
         }
-        if (privateSecureAddress != "localhost") {
+        if (!privateSecureAddress.matches(".*\\w.*")) {
             clientIPRanges.add(privateSecureAddress + "/32");
         }
 
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/oidc/OIDCTest.java b/src/test/java/net/shibboleth/idp/integration/tests/oidc/OIDCTest.java
index 3b19d67..b7578a1 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/oidc/OIDCTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/oidc/OIDCTest.java
@@ -415,10 +415,12 @@ public class OIDCTest extends BaseIntegrationTest {
 
         final String openidConfigurationURL = baseURL + "/.well-known/openid-configuration";
 
-        log.debug("Attempting to get openid-configuration URL '{}'", openidConfigurationURL);
+        log.debug("Attempting to get openid-configuration URL '{}' from browser", openidConfigurationURL);
 
         driver.get(openidConfigurationURL);
 
+        waitForPageURLContains("/.well-known/openid-configuration");
+
         final String pageSource = getPageSource();
 
         // TODO why quoted / ?
@@ -441,7 +443,7 @@ public class OIDCTest extends BaseIntegrationTest {
 
         final String openidConfigurationURL = baseURL + "/.well-known/openid-configuration";
 
-        log.debug("Attempting to get openid-configuration URL '{}'", openidConfigurationURL);
+        log.debug("Attempting to get openid-configuration URL '{}' from container", openidConfigurationURL);
 
         final ExecResult result = rp.container.execInContainer( //
                 "curl", //
@@ -579,18 +581,12 @@ public class OIDCTest extends BaseIntegrationTest {
     public void testSSO(@Nullable final BrowserData browserData) throws Exception {
 
         // Install OIDC OP plugin
-
-        // TODO local install
-        installLocalPlugin("net.shibboleth.oidc.common", "oidc-common-dist-3.0.1.tar.gz");
-        installLocalPlugin("net.shibboleth.idp.plugin.oidc.config", "idp-plugin-oidc-config-dist-2.0.0.tar.gz");
-        installLocalPlugin("net.shibboleth.idp.plugin.oidc.op", "idp-plugin-oidc-op-distribution-4.0.0.tar.gz");
-
-        // TODO remote install
         final String[] plugins = new String[] { //
                 "net.shibboleth.oidc.common", //
                 "net.shibboleth.idp.plugin.oidc.config", //
                 "net.shibboleth.idp.plugin.oidc.op" };
-        // installPlugins(plugins);
+
+        installPlugins(plugins);
 
         assertPluginsAreInstalled(plugins);
 
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/oidc/RPContainer.java b/src/test/java/net/shibboleth/idp/integration/tests/oidc/RPContainer.java
index 7f5d9b8..f79182d 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/oidc/RPContainer.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/oidc/RPContainer.java
@@ -227,10 +227,7 @@ public class RPContainer extends AbstractIdentifiableInitializableComponent impl
         final ImageFromDockerfile imageFromDockerfile = new ImageFromDockerfile(image, false)
                 .withDockerfile(pathToDockerfile());
         log.debug("{} Initializing with image '{}'", getLogPrefix(), imageFromDockerfile);
-
-        // TODO Does this build the image if it does not exist or is updated ?
-        log.debug("{} Initializing generic container", getLogPrefix());
-        container = new GenericContainer<>(imageFromDockerfile.getDockerImageName());
+        container = new GenericContainer<>(imageFromDockerfile);
 
         // Copy TLS cert and key to container
         final MountableFile cert = MountableFile.forHostPath(pathToCert());

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


More information about the commits mailing list