From 52ef55a83470054dd55f133db92e87cdf4d8afdd Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Thu, 6 Mar 2025 14:47:35 +0100 Subject: [PATCH] Add missing changes from some backport --- selenium/bin/components/fakeportal | 2 ++ selenium/bin/components/uaa | 9 ++--- selenium/bin/suite_template | 4 +-- selenium/fakeportal/app.js | 3 +- selenium/test/oauth/env.docker.fakeportal | 2 +- selenium/test/oauth/env.docker.uaa | 2 +- selenium/test/oauth/env.local.fakeportal | 2 +- selenium/test/oauth/env.local.uaa | 2 +- selenium/test/oauth/uaa/server.xml | 43 +++++++++++++++++++++++ selenium/test/oauth/uaa/uaa.yml | 5 ++- 10 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 selenium/test/oauth/uaa/server.xml diff --git a/selenium/bin/components/fakeportal b/selenium/bin/components/fakeportal index aadbda50327b..006b0d070db4 100644 --- a/selenium/bin/components/fakeportal +++ b/selenium/bin/components/fakeportal @@ -44,6 +44,8 @@ start_fakeportal() { --env UAA_URL="${UAA_URL_FOR_FAKEPORTAL}" \ --env CLIENT_ID="${CLIENT_ID}" \ --env CLIENT_SECRET="${CLIENT_SECRET}" \ + --env NODE_EXTRA_CA_CERTS=/etc/uaa/ca_uaa_certificate.pem \ + -v ${TEST_CONFIG_DIR}/uaa:/etc/uaa \ -v ${FAKEPORTAL_DIR}:/code/fakeportal \ mocha-test:${mocha_test_tag} run fakeportal diff --git a/selenium/bin/components/uaa b/selenium/bin/components/uaa index b344ee0211bd..ba1c005fac41 100644 --- a/selenium/bin/components/uaa +++ b/selenium/bin/components/uaa @@ -37,12 +37,13 @@ start_uaa() { --detach \ --name uaa \ --net ${DOCKER_NETWORK} \ - --publish 8080:8080 \ - --mount "type=bind,source=$MOUNT_UAA_CONF_DIR,target=/uaa" \ + --publish 8443:8443 \ + -v ${MOUNT_UAA_CONF_DIR}:/uaa \ + -v ${UAA_CONFIG_DIR}/server.xml:/layers/paketo-buildpacks_apache-tomcat/catalina-base/conf/server.xml \ --env UAA_CONFIG_PATH="/uaa" \ - --env JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom" \ + --env JAVA_OPTS="-Djava.security.policy=unlimited -Djava.security.egd=file:/dev/./urandom" \ ${UAA_DOCKER_IMAGE} - + wait_for_oidc_endpoint uaa $UAA_URL end "UAA is ready" } diff --git a/selenium/bin/suite_template b/selenium/bin/suite_template index 4b8427994dfe..ccea295f5a1e 100644 --- a/selenium/bin/suite_template +++ b/selenium/bin/suite_template @@ -170,7 +170,7 @@ wait_for_oidc_endpoint() { wait_for_oidc_endpoint_local() { NAME=$1 BASE_URL=$2 - CURL_ARGS="-L --fail " + CURL_ARGS="-L -k --fail " DELAY_BETWEEN_ATTEMPTS=5 if [[ $# -eq 3 ]]; then CURL_ARGS="$CURL_ARGS --cacert $3" @@ -191,7 +191,7 @@ wait_for_oidc_endpoint_local() { wait_for_oidc_endpoint_docker() { NAME=$1 BASE_URL=$2 - CURL_ARGS="-L --fail " + CURL_ARGS="-L -k --fail " DOCKER_ARGS="--rm --net ${DOCKER_NETWORK} " DELAY_BETWEEN_ATTEMPTS=5 if [[ $# -gt 2 ]]; then diff --git a/selenium/fakeportal/app.js b/selenium/fakeportal/app.js index ea0ff1a37021..ab0b676262fd 100644 --- a/selenium/fakeportal/app.js +++ b/selenium/fakeportal/app.js @@ -58,6 +58,7 @@ function access_token(id, secret) { console.log("Token => " + token) return token; } else { - throw new Error(req.status + " : " + req.responseText); + throw new Error(req.status + " : " + " : " + + req.response + " : " + req.responseText) } } diff --git a/selenium/test/oauth/env.docker.fakeportal b/selenium/test/oauth/env.docker.fakeportal index fc6d56f47b3a..685c0c17a056 100644 --- a/selenium/test/oauth/env.docker.fakeportal +++ b/selenium/test/oauth/env.docker.fakeportal @@ -1,3 +1,3 @@ export FAKEPORTAL_URL=http://fakeportal:3000 export RABBITMQ_HOST_FOR_FAKEPORTAL=${RABBITMQ_HOST} -export UAA_URL_FOR_FAKEPORTAL=http://uaa:8080 +export UAA_URL_FOR_FAKEPORTAL=https://uaa:8443 diff --git a/selenium/test/oauth/env.docker.uaa b/selenium/test/oauth/env.docker.uaa index afc439185290..df2a89c61371 100644 --- a/selenium/test/oauth/env.docker.uaa +++ b/selenium/test/oauth/env.docker.uaa @@ -1 +1 @@ -export UAA_URL=http://uaa:8080 +export UAA_URL=https://uaa:8443 diff --git a/selenium/test/oauth/env.local.fakeportal b/selenium/test/oauth/env.local.fakeportal index 520c2ce34c42..488f3fd447d8 100644 --- a/selenium/test/oauth/env.local.fakeportal +++ b/selenium/test/oauth/env.local.fakeportal @@ -1,3 +1,3 @@ export FAKEPORTAL_URL=http://localhost:3000 export RABBITMQ_HOST_FOR_FAKEPORTAL=localhost:15672 -export UAA_URL_FOR_FAKEPORTAL=http://host.docker.internal:8080 +export UAA_URL_FOR_FAKEPORTAL=https://uaa:8443 diff --git a/selenium/test/oauth/env.local.uaa b/selenium/test/oauth/env.local.uaa index 40d8bf716099..9caac0c8f537 100644 --- a/selenium/test/oauth/env.local.uaa +++ b/selenium/test/oauth/env.local.uaa @@ -1 +1 @@ -export UAA_URL=http://localhost:8080 +export UAA_URL=https://localhost:8443 diff --git a/selenium/test/oauth/uaa/server.xml b/selenium/test/oauth/uaa/server.xml new file mode 100644 index 000000000000..f86407ddf87a --- /dev/null +++ b/selenium/test/oauth/uaa/server.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/selenium/test/oauth/uaa/uaa.yml b/selenium/test/oauth/uaa/uaa.yml index 546a78402f2a..99d812862038 100644 --- a/selenium/test/oauth/uaa/uaa.yml +++ b/selenium/test/oauth/uaa/uaa.yml @@ -1,3 +1,6 @@ +require_https: true +https_port: 8443 + logging: config: /uaa/log4j2.properties @@ -214,4 +217,4 @@ cors: - GET - PUT - POST - - DELETE + - DELETE \ No newline at end of file