From 8bb532a6f785d696d5ae3375e7d27fb97bcb2851 Mon Sep 17 00:00:00 2001 From: "build@metaventis.com" Date: Tue, 28 Nov 2023 03:18:06 +0000 Subject: [PATCH 1/2] Bump SDK --- .../compose/src/main/scripts/.env.sample | 15 ++++++-- .../src/main/build/assets/entrypoint.sh | 35 ++++++++++++------- .../src/main/compose/1_repository-common.yml | 3 ++ .../src/main/chart/templates/statefulset.yaml | 3 -- .../src/main/build/assets/entrypoint.sh | 3 +- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/deploy/docker/compose/src/main/scripts/.env.sample b/deploy/docker/compose/src/main/scripts/.env.sample index a585319b..9e53283c 100644 --- a/deploy/docker/compose/src/main/scripts/.env.sample +++ b/deploy/docker/compose/src/main/scripts/.env.sample @@ -114,15 +114,24 @@ # --- relative login path from external authentication service # REPOSITORY_SERVICE_AUTH_EXTERNAL_LOGIN=/shibboleth -# --- relative logout path from external authentication service -# REPOSITORY_SERVICE_AUTH_EXTERNAL_LOGOUT=/logout - # --- absolut path from external authentication provider # REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGIN_PROVIDERS_URL= # --- relative logout path from external authentication target provider # REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGIN_PROVIDER_TARGET_URL= +# --- relative logout path from external authentication service +# REPOSITORY_SERVICE_AUTH_EXTERNAL_LOGOUT=/Shibboleth.sso/Logout + +# --- should edu-sharing destroy it's session or does this the idp for us +# REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT_DESTROY_SESSION=false + +# --- should edu-sharing redirected us to a page after the logout? +# REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT_REDIRECT=false + +# --- the url to redirect to if redirect is true +# REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT_REDIRECT_URL= + # --- guest user name # REPOSITORY_SERVICE_GUEST_USER= diff --git a/deploy/docker/repository/build/service/src/main/build/assets/entrypoint.sh b/deploy/docker/repository/build/service/src/main/build/assets/entrypoint.sh index f63f2799..7a03a794 100755 --- a/deploy/docker/repository/build/service/src/main/build/assets/entrypoint.sh +++ b/deploy/docker/repository/build/service/src/main/build/assets/entrypoint.sh @@ -26,7 +26,12 @@ my_home_appid="${REPOSITORY_SERVICE_HOME_APPID:-local}" my_home_auth="${REPOSITORY_SERVICE_HOME_AUTH:-}" my_home_auth_external="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL:-false}" my_home_auth_external_login="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGIN:-$my_path_external/shibboleth}" -my_home_auth_external_logout="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT:-}" + +my_home_auth_external_logout="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT:-/Shibboleth.sso/Logout}" +my_home_auth_external_logout_destroy_session="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT_DESTROY_SESSION:-"false"}" +my_home_auth_external_logout_redirect="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT_REDIRECT:-"false"}" +my_home_auth_external_logout_redirect_url="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGOUT_REDIRECT_URL:-$my_base_external}" + my_home_auth_external_login_providers_url="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGIN_PROVIDERS_URL:-}" my_home_auth_external_login_provider_target_url="${REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGIN_PROVIDER_TARGET_URL:-}" my_home_provider="${REPOSITORY_SERVICE_HOME_PROVIDER:-}" @@ -453,19 +458,25 @@ xmlstarlet ed -L \ -s '/config/values' -t elem -n 'loginProviderTargetUrl' -v '' \ -d '/config/values/loginProviderTargetUrl[position() != 1]' \ -u '/config/values/loginProviderTargetUrl' -v "${my_home_auth_external_login_provider_target_url}" \ + -s '/config/values' -t elem -n 'logout' -v '' \ + -d '/config/values/logout[position() != 1]' \ + -s '/config/values/logout' -t elem -n 'url' -v '' \ + -d '/config/values/logout/url[position() != 1]' \ + -u '/config/values/logout/url' -v "${my_home_auth_external_logout}" \ + -s '/config/values/logout' -t elem -n 'destroySession' -v '' \ + -d '/config/values/logout/destroySession[position() != 1]' \ + -u '/config/values/logout/destroySession' -v "${my_home_auth_external_logout_destroy_session}" \ ${eduCConf} - if [[ -n "${my_home_auth_external_logout}" ]] ; then - xmlstarlet ed -L \ - -s '/config/values' -t elem -n 'logout' -v '' \ - -d '/config/values/logout[position() != 1]' \ - -s '/config/values/logout' -t elem -n 'url' -v '' \ - -d '/config/values/logout/url[position() != 1]' \ - -u '/config/values/logout/url' -v "${my_home_auth_external_logout}" \ - -s '/config/values/logout' -t elem -n 'destroySession' -v '' \ - -d '/config/values/logout/destroySession[position() != 1]' \ - -u '/config/values/logout/destroySession' -v 'false' \ - ${eduCConf} + if [[ "${my_home_auth_external_logout_redirect}" == "true" ]] ; then + xmlstarlet ed -L \ + -s '/config/values/logout' -t elem -n 'ajax' -v '' \ + -d '/config/values/logout/ajax[position() != 1]' \ + -u '/config/values/logout/ajax' -v 'true' \ + -s '/config/values/logout' -t elem -n 'next' -v '' \ + -d '/config/values/logout/next[position() != 1]' \ + -u '/config/values/logout/next' -v "${my_home_auth_external_logout_redirect_url}" \ + ${eduCConf} fi else sed -i -r 's|