From 5e5a4bb9fc0a7f0694bbf0f7903052310320b045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20L=C3=B6ffler?= Date: Mon, 9 Jan 2023 03:28:33 +0100 Subject: [PATCH 1/4] Change the default hostname for containers --- docker-entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b469787..d288616 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -2,4 +2,8 @@ set -euo pipefail +if [[ -z "${SERVER_HOSTNAME:-}" ]]; then + export SERVER_HOSTNAME="0.0.0.0" +fi + exec "$@" From ad5e08d4851599847473c987e93c055ebf866417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20L=C3=B6ffler?= Date: Mon, 9 Jan 2023 05:55:55 +0100 Subject: [PATCH 2/4] Use env variable for Keycloak test port --- test/services/keycloak/docker-start.sh | 2 +- test/services/keycloak/docker/start.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/services/keycloak/docker-start.sh b/test/services/keycloak/docker-start.sh index 71eea1e..41f82f8 100755 --- a/test/services/keycloak/docker-start.sh +++ b/test/services/keycloak/docker-start.sh @@ -6,7 +6,7 @@ docker run \ --name keycloak-slo-test-container \ --detach \ --net=host \ - --env "HTTP_PORT=8190" \ + --env "KC_HTTP_PORT=8190" \ --env "KEYCLOAK_ADMIN=admin" \ --env "KEYCLOAK_ADMIN_PASSWORD=password" \ slo-with-keycloak-test:latest diff --git a/test/services/keycloak/docker/start.sh b/test/services/keycloak/docker/start.sh index a7f9e77..1e26953 100755 --- a/test/services/keycloak/docker/start.sh +++ b/test/services/keycloak/docker/start.sh @@ -11,6 +11,5 @@ fi /opt/keycloak/bin/kc.sh start-dev \ --auto-build \ --http-enabled=true \ - --http-port="$HTTP_PORT" \ --hostname-strict=false \ --hostname-strict-https=false From 302e041b36b793326eef1ba02aec0fcb5c3ca327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20L=C3=B6ffler?= Date: Mon, 9 Jan 2023 06:28:59 +0100 Subject: [PATCH 3/4] Use IP based hostname for tests --- .../central-saml-logout/docker-start.sh | 14 ++++---- test/services/keycloak/docker-start.sh | 2 +- .../keycloak/docker/realms/realm-export.json | 32 +++++++++---------- test/services/proxy/docker-start.sh | 2 +- .../proxy/docker/proxy.conf.apache2.txt | 18 +++++------ .../proxy/docker/proxy.conf.nginx.txt | 8 ++--- test/services/test-client/docker-start.sh | 10 +++--- ...lient-login-and-logout-via-apache2.test.js | 10 +++--- .../client-login-and-logout-via-nginx.test.js | 10 +++--- ...-and-redirected-logout-via-apache2.test.js | 8 ++--- ...in-and-redirected-logout-via-nginx.test.js | 8 ++--- test/src/client-login-fail-via-nginx.test.js | 6 ++-- ...t-login-and-local-logout-via-nginx.test.js | 14 ++++---- .../direct-login-and-logout-via-nginx.test.js | 10 +++--- 14 files changed, 76 insertions(+), 76 deletions(-) diff --git a/test/services/central-saml-logout/docker-start.sh b/test/services/central-saml-logout/docker-start.sh index 8fe5ef3..7d1accc 100755 --- a/test/services/central-saml-logout/docker-start.sh +++ b/test/services/central-saml-logout/docker-start.sh @@ -8,10 +8,10 @@ docker run \ --net=host \ --env 'SERVER_HOSTNAME=0.0.0.0' \ --env 'SERVER_PORT=8191' \ - --env 'BASE_URL=http://localhost:8181/slo' \ + --env 'BASE_URL=http://127.0.0.1:8181/slo' \ --env 'PATH_PREFIX=/app-prefix' \ - --env 'IDP_METADATA=http://localhost:8190/realms/master/protocol/saml/descriptor' \ - --env 'COOKIES_TO_CLEAR=[{"domain":"localhost","name":"central-saml-logout-session-client-prefix"}]' \ + --env 'IDP_METADATA=http://127.0.0.1:8190/realms/master/protocol/saml/descriptor' \ + --env 'COOKIES_TO_CLEAR=[{"domain":"127.0.0.1","name":"central-saml-logout-session-client-prefix"}]' \ central-saml-logout:latest docker run \ @@ -20,13 +20,13 @@ docker run \ --net=host \ --env 'SERVER_HOSTNAME=0.0.0.0' \ --env 'SERVER_PORT=8192' \ - --env 'BASE_URL=http://localhost:8182/slo' \ + --env 'BASE_URL=http://127.0.0.1:8182/slo' \ --env 'PATH_PREFIX=/app-prefix' \ - --env 'IDP_METADATA=http://localhost:8190/realms/master/protocol/saml/descriptor' \ - --env 'COOKIES_TO_CLEAR=[{"domain":"localhost","name":"central-saml-logout-session-client-prefix"}]' \ + --env 'IDP_METADATA=http://127.0.0.1:8190/realms/master/protocol/saml/descriptor' \ + --env 'COOKIES_TO_CLEAR=[{"domain":"127.0.0.1","name":"central-saml-logout-session-client-prefix"}]' \ central-saml-logout:latest -while ! nc -z localhost 8191 || ! nc -z localhost 8192; do +while ! nc -z 127.0.0.1 8191 || ! nc -z 127.0.0.1 8192; do echo "Waiting 5 seconds for application instances to come up." sleep 5 done diff --git a/test/services/keycloak/docker-start.sh b/test/services/keycloak/docker-start.sh index 41f82f8..d0e8270 100755 --- a/test/services/keycloak/docker-start.sh +++ b/test/services/keycloak/docker-start.sh @@ -11,7 +11,7 @@ docker run \ --env "KEYCLOAK_ADMIN_PASSWORD=password" \ slo-with-keycloak-test:latest -while ! nc -z localhost 8190; do +while ! nc -z 127.0.0.1 8190; do echo "Waiting 5 seconds for Keycloak to come up." sleep 5 done diff --git a/test/services/keycloak/docker/realms/realm-export.json b/test/services/keycloak/docker/realms/realm-export.json index 6e1261d..c900b77 100644 --- a/test/services/keycloak/docker/realms/realm-export.json +++ b/test/services/keycloak/docker/realms/realm-export.json @@ -4,18 +4,18 @@ "clients": [ { "id": "f64e4da3-d5c1-4ded-bd90-53afca9cc6bf", - "clientId": "http://localhost:8181/slo/app-prefix/login/callback", + "clientId": "http://127.0.0.1:8181/slo/app-prefix/login/callback", "name": "slo app 8181", "description": "", - "rootUrl": "http://localhost:8181/slo/app-prefix", - "adminUrl": "http://localhost:8181/slo/app-prefix/login/callback", + "rootUrl": "http://127.0.0.1:8181/slo/app-prefix", + "adminUrl": "http://127.0.0.1:8181/slo/app-prefix/login/callback", "baseUrl": "", "surrogateAuthRequired": false, "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", "redirectUris": [ - "http://localhost:8181/slo/app-prefix/*" + "http://127.0.0.1:8181/slo/app-prefix/*" ], "webOrigins": [], "notBefore": 0, @@ -61,18 +61,18 @@ }, { "id": "7bae782f-9563-4dbb-a714-3328ee35245b", - "clientId": "http://localhost:8182/slo/app-prefix/login/callback", + "clientId": "http://127.0.0.1:8182/slo/app-prefix/login/callback", "name": "slo app 8182", "description": "", - "rootUrl": "http://localhost:8182/slo/app-prefix", - "adminUrl": "http://localhost:8182/slo/app-prefix/login/callback", + "rootUrl": "http://127.0.0.1:8182/slo/app-prefix", + "adminUrl": "http://127.0.0.1:8182/slo/app-prefix/login/callback", "baseUrl": "", "surrogateAuthRequired": false, "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", "redirectUris": [ - "http://localhost:8182/slo/app-prefix/*" + "http://127.0.0.1:8182/slo/app-prefix/*" ], "webOrigins": [], "notBefore": 0, @@ -117,18 +117,18 @@ }, { "id": "cb784ffe-94f6-4dbf-a6a5-36a83296d05e", - "clientId": "http://localhost:8183/test-client/client-prefix/login/callback", + "clientId": "http://127.0.0.1:8183/test-client/client-prefix/login/callback", "name": "test client 8183", "description": "", - "rootUrl": "http://localhost:8183/test-client/client-prefix", - "adminUrl": "http://localhost:8183/test-client/client-prefix/login/callback", + "rootUrl": "http://127.0.0.1:8183/test-client/client-prefix", + "adminUrl": "http://127.0.0.1:8183/test-client/client-prefix/login/callback", "baseUrl": "", "surrogateAuthRequired": false, "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", "redirectUris": [ - "http://localhost:8183/test-client/client-prefix/*" + "http://127.0.0.1:8183/test-client/client-prefix/*" ], "webOrigins": [], "notBefore": 0, @@ -174,18 +174,18 @@ }, { "id": "b250b858-edfb-4a40-8cb5-ac373753b812", - "clientId": "http://localhost:8184/test-client/client-prefix/login/callback", + "clientId": "http://127.0.0.1:8184/test-client/client-prefix/login/callback", "name": "test client 8184", "description": "", - "rootUrl": "http://localhost:8184/test-client/client-prefix", - "adminUrl": "http://localhost:8184/test-client/client-prefix/login/callback", + "rootUrl": "http://127.0.0.1:8184/test-client/client-prefix", + "adminUrl": "http://127.0.0.1:8184/test-client/client-prefix/login/callback", "baseUrl": "", "surrogateAuthRequired": false, "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", "redirectUris": [ - "http://localhost:8184/test-client/client-prefix/*" + "http://127.0.0.1:8184/test-client/client-prefix/*" ], "webOrigins": [], "notBefore": 0, diff --git a/test/services/proxy/docker-start.sh b/test/services/proxy/docker-start.sh index 51d9ae8..e739bc0 100755 --- a/test/services/proxy/docker-start.sh +++ b/test/services/proxy/docker-start.sh @@ -16,7 +16,7 @@ docker run \ --env "PROXY=nginx" \ slo-with-proxy-test:latest -while ! nc -z localhost 8181 || ! nc -z localhost 8182 || ! nc -z localhost 8183 || ! nc -z localhost 8184; do +while ! nc -z 127.0.0.1 8181 || ! nc -z 127.0.0.1 8182 || ! nc -z 127.0.0.1 8183 || ! nc -z 127.0.0.1 8184; do echo "Waiting 5 seconds for the proxy servers to come up." sleep 5 done diff --git a/test/services/proxy/docker/proxy.conf.apache2.txt b/test/services/proxy/docker/proxy.conf.apache2.txt index 1585971..cf45462 100644 --- a/test/services/proxy/docker/proxy.conf.apache2.txt +++ b/test/services/proxy/docker/proxy.conf.apache2.txt @@ -1,20 +1,20 @@ Listen 8181 Listen 8183 -ServerName localhost +ServerName 127.0.0.1 ProxyRequests Off - ServerName localhost + ServerName 127.0.0.1 Order deny,allow Allow from all - ProxyPass /slo http://localhost:8191 - ProxyPassReverse /slo http://localhost:8191 + ProxyPass /slo http://127.0.0.1:8191 + ProxyPassReverse /slo http://127.0.0.1:8191 @@ -23,20 +23,20 @@ ServerName localhost ProxyRequests Off RewriteEngine on - ServerName localhost + ServerName 127.0.0.1 Header set Access-Control-Allow-Credentials "true" Header set Access-Control-Allow-Headers "Set-Cookie" - Header set Access-Control-Allow-Origin "http://localhost:8181" + Header set Access-Control-Allow-Origin "http://127.0.0.1:8181" - RewriteRule ^/test-client/client-prefix/logout/local$ "http://localhost:8181/slo/app-prefix/logout?http://localhost:8183/test-client/client-prefix/status" [R=302,L] + RewriteRule ^/test-client/client-prefix/logout/local$ "http://127.0.0.1:8181/slo/app-prefix/logout?http://127.0.0.1:8183/test-client/client-prefix/status" [R=302,L] Order deny,allow Allow from all - ProxyPass /test-client http://localhost:8193 - ProxyPassReverse /test-client http://localhost:8193 + ProxyPass /test-client http://127.0.0.1:8193 + ProxyPassReverse /test-client http://127.0.0.1:8193 diff --git a/test/services/proxy/docker/proxy.conf.nginx.txt b/test/services/proxy/docker/proxy.conf.nginx.txt index 4c51007..b046451 100644 --- a/test/services/proxy/docker/proxy.conf.nginx.txt +++ b/test/services/proxy/docker/proxy.conf.nginx.txt @@ -7,7 +7,7 @@ server { location ~ ^/slo/ { rewrite ^/slo/(.*)$ /$1 break; - proxy_pass http://localhost:8192; + proxy_pass http://127.0.0.1:8192; } } @@ -20,14 +20,14 @@ server { add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Headers Set-Cookie; - add_header Access-Control-Allow-Origin http://localhost:8182; + add_header Access-Control-Allow-Origin http://127.0.0.1:8182; location ~ ^/test-client/client-prefix/logout/local$ { - return 302 http://localhost:8182/slo/app-prefix/logout?http://localhost:8184/test-client/client-prefix/status; + return 302 http://127.0.0.1:8182/slo/app-prefix/logout?http://127.0.0.1:8184/test-client/client-prefix/status; } location ~ ^/test-client/ { rewrite ^/test-client/(.*)$ /$1 break; - proxy_pass http://localhost:8194; + proxy_pass http://127.0.0.1:8194; } } diff --git a/test/services/test-client/docker-start.sh b/test/services/test-client/docker-start.sh index 5f31bb7..68f31c3 100755 --- a/test/services/test-client/docker-start.sh +++ b/test/services/test-client/docker-start.sh @@ -8,9 +8,9 @@ docker run \ --net=host \ --env 'SERVER_HOSTNAME=0.0.0.0' \ --env 'SERVER_PORT=8193' \ - --env 'BASE_URL=http://localhost:8183/test-client' \ + --env 'BASE_URL=http://127.0.0.1:8183/test-client' \ --env 'PATH_PREFIX=/client-prefix' \ - --env 'IDP_METADATA=http://localhost:8190/realms/master/protocol/saml/descriptor' \ + --env 'IDP_METADATA=http://127.0.0.1:8190/realms/master/protocol/saml/descriptor' \ central-saml-logout:latest docker run \ @@ -19,12 +19,12 @@ docker run \ --net=host \ --env 'SERVER_HOSTNAME=0.0.0.0' \ --env 'SERVER_PORT=8194' \ - --env 'BASE_URL=http://localhost:8184/test-client' \ + --env 'BASE_URL=http://127.0.0.1:8184/test-client' \ --env 'PATH_PREFIX=/client-prefix' \ - --env 'IDP_METADATA=http://localhost:8190/realms/master/protocol/saml/descriptor' \ + --env 'IDP_METADATA=http://127.0.0.1:8190/realms/master/protocol/saml/descriptor' \ central-saml-logout:latest -while ! nc -z localhost 8193 || ! nc -z localhost 8194; do +while ! nc -z 127.0.0.1 8193 || ! nc -z 127.0.0.1 8194; do echo "Waiting 5 seconds for test clients to come up." sleep 5 done diff --git a/test/src/client-login-and-logout-via-apache2.test.js b/test/src/client-login-and-logout-via-apache2.test.js index a5b8e00..2c3672a 100644 --- a/test/src/client-login-and-logout-via-apache2.test.js +++ b/test/src/client-login-and-logout-via-apache2.test.js @@ -2,7 +2,7 @@ describe('Use case: client login and logout via apache2', () => { it('should have an inactive session at the beginning', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -10,7 +10,7 @@ describe('Use case: client login and logout via apache2', () => { it('should show the Keycloak login page', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/login'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/login'); await expect(page.title()).resolves.toMatch('Sign in to master'); }); @@ -29,7 +29,7 @@ describe('Use case: client login and logout via apache2', () => { it('should have an active session', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session active'); @@ -37,7 +37,7 @@ describe('Use case: client login and logout via apache2', () => { it('should be possible to logout via SLO directly', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/logout'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/logout'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Logout was successful'); @@ -45,7 +45,7 @@ describe('Use case: client login and logout via apache2', () => { it('should have an inactive session again', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); diff --git a/test/src/client-login-and-logout-via-nginx.test.js b/test/src/client-login-and-logout-via-nginx.test.js index 85134ba..7862725 100644 --- a/test/src/client-login-and-logout-via-nginx.test.js +++ b/test/src/client-login-and-logout-via-nginx.test.js @@ -2,7 +2,7 @@ describe('Use case: client login and logout via nginx', () => { it('should have an inactive session at the beginning', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -10,7 +10,7 @@ describe('Use case: client login and logout via nginx', () => { it('should show the Keycloak login page', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/login'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/login'); await expect(page.title()).resolves.toMatch('Sign in to master'); }); @@ -29,7 +29,7 @@ describe('Use case: client login and logout via nginx', () => { it('should have an active session', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session active'); @@ -37,7 +37,7 @@ describe('Use case: client login and logout via nginx', () => { it('should be possible to logout via SLO directly', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/logout'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/logout'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Logout was successful'); @@ -45,7 +45,7 @@ describe('Use case: client login and logout via nginx', () => { it('should have an inactive session again', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); diff --git a/test/src/client-login-and-redirected-logout-via-apache2.test.js b/test/src/client-login-and-redirected-logout-via-apache2.test.js index a7f39e0..c51b27a 100644 --- a/test/src/client-login-and-redirected-logout-via-apache2.test.js +++ b/test/src/client-login-and-redirected-logout-via-apache2.test.js @@ -2,7 +2,7 @@ describe('Use case: client login and redirected logout via apache2', () => { it('should have an inactive session at the beginning', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -10,7 +10,7 @@ describe('Use case: client login and redirected logout via apache2', () => { it('should show the Keycloak login page', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/login'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/login'); await expect(page.title()).resolves.toMatch('Sign in to master'); }); @@ -29,7 +29,7 @@ describe('Use case: client login and redirected logout via apache2', () => { it('should have an active session', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session active'); @@ -37,7 +37,7 @@ describe('Use case: client login and redirected logout via apache2', () => { it('should redirect the local client logout', async () => { - await page.goto('http://localhost:8183/test-client/client-prefix/logout/local'); + await page.goto('http://127.0.0.1:8183/test-client/client-prefix/logout/local'); await page.waitForNavigation({waitUntil: 'networkidle0'}); const content = await page.$eval('*', x => x.innerText); diff --git a/test/src/client-login-and-redirected-logout-via-nginx.test.js b/test/src/client-login-and-redirected-logout-via-nginx.test.js index 262fb9b..6880dca 100644 --- a/test/src/client-login-and-redirected-logout-via-nginx.test.js +++ b/test/src/client-login-and-redirected-logout-via-nginx.test.js @@ -2,7 +2,7 @@ describe('Use case: client login and redirected logout via nginx', () => { it('should have an inactive session at the beginning', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -10,7 +10,7 @@ describe('Use case: client login and redirected logout via nginx', () => { it('should show the Keycloak login page', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/login'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/login'); await expect(page.title()).resolves.toMatch('Sign in to master'); }); @@ -29,7 +29,7 @@ describe('Use case: client login and redirected logout via nginx', () => { it('should have an active session', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session active'); @@ -37,7 +37,7 @@ describe('Use case: client login and redirected logout via nginx', () => { it('should redirect the local client logout', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/logout/local'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/logout/local'); await page.waitForNavigation({waitUntil: 'networkidle0'}); const content = await page.$eval('*', x => x.innerText); diff --git a/test/src/client-login-fail-via-nginx.test.js b/test/src/client-login-fail-via-nginx.test.js index b47d59b..2ce6461 100644 --- a/test/src/client-login-fail-via-nginx.test.js +++ b/test/src/client-login-fail-via-nginx.test.js @@ -2,7 +2,7 @@ describe('Use case: client login fail via nginx', () => { it('should have an inactive session at the beginning', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -10,7 +10,7 @@ describe('Use case: client login fail via nginx', () => { it('should show the Keycloak login page', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/login'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/login'); await expect(page.title()).resolves.toMatch('Sign in to master'); }); @@ -28,7 +28,7 @@ describe('Use case: client login fail via nginx', () => { it('should have still an inactive session', async () => { - await page.goto('http://localhost:8184/test-client/client-prefix/status'); + await page.goto('http://127.0.0.1:8184/test-client/client-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); diff --git a/test/src/direct-login-and-local-logout-via-nginx.test.js b/test/src/direct-login-and-local-logout-via-nginx.test.js index b62f692..5394535 100644 --- a/test/src/direct-login-and-local-logout-via-nginx.test.js +++ b/test/src/direct-login-and-local-logout-via-nginx.test.js @@ -2,7 +2,7 @@ describe('Use case: direct login and local logout via nginx', () => { it('should have an inactive session at the beginning', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/status'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -10,7 +10,7 @@ describe('Use case: direct login and local logout via nginx', () => { it('should show the Keycloak login page', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/login'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/login'); await expect(page.title()).resolves.toMatch('Sign in to master'); }); @@ -29,7 +29,7 @@ describe('Use case: direct login and local logout via nginx', () => { it('should have an active session', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/status'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session active'); @@ -37,7 +37,7 @@ describe('Use case: direct login and local logout via nginx', () => { it('should be possible to logout locally', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/logout/local'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/logout/local'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Logout was successful'); @@ -45,7 +45,7 @@ describe('Use case: direct login and local logout via nginx', () => { it('should have an inactive session again', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/status'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -53,7 +53,7 @@ describe('Use case: direct login and local logout via nginx', () => { it('should show have still an active Keycloak session', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/login'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/login'); await page.waitForNavigation({waitUntil: 'networkidle0'}); const content = await page.$eval('*', x => x.innerText); @@ -62,7 +62,7 @@ describe('Use case: direct login and local logout via nginx', () => { it('should be possible to logout via SLO directly', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/logout'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/logout'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Logout was successful'); diff --git a/test/src/direct-login-and-logout-via-nginx.test.js b/test/src/direct-login-and-logout-via-nginx.test.js index 3abcfb9..f33867d 100644 --- a/test/src/direct-login-and-logout-via-nginx.test.js +++ b/test/src/direct-login-and-logout-via-nginx.test.js @@ -2,7 +2,7 @@ describe('Use case: direct login and logout via nginx', () => { it('should have an inactive session at the beginning', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/status'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); @@ -10,7 +10,7 @@ describe('Use case: direct login and logout via nginx', () => { it('should show the Keycloak login page', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/login'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/login'); await expect(page.title()).resolves.toMatch('Sign in to master'); }); @@ -29,7 +29,7 @@ describe('Use case: direct login and logout via nginx', () => { it('should have an active session', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/status'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session active'); @@ -37,7 +37,7 @@ describe('Use case: direct login and logout via nginx', () => { it('should be possible to logout via SLO directly', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/logout'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/logout'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Logout was successful'); @@ -45,7 +45,7 @@ describe('Use case: direct login and logout via nginx', () => { it('should have an inactive session again', async () => { - await page.goto('http://localhost:8182/slo/app-prefix/status'); + await page.goto('http://127.0.0.1:8182/slo/app-prefix/status'); const content = await page.$eval('*', x => x.innerText); expect(content).toEqual('Session inactive'); From d33e8f6eef2c7db2b8575f09490052be026898b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20L=C3=B6ffler?= Date: Mon, 9 Jan 2023 03:30:28 +0100 Subject: [PATCH 4/4] Update version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3b6b6c..dc5811f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "central-saml-logout", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "central-saml-logout", - "version": "1.0.0", + "version": "1.0.1", "license": "Apache License, Version 2.0", "dependencies": { "body-parser": "^1.20.x", diff --git a/package.json b/package.json index e71e44c..6792544 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "central-saml-logout", - "version": "1.0.0", + "version": "1.0.1", "description": "A dedicated service to perform a SAML 2.0 Single Logout (SLO)", "license": "Apache License, Version 2.0", "homepage": "https://github.com/aservo/central-saml-logout#readme",