From 9ef0793b5fcd5e8c44f6ecc2da416994dc1fdc42 Mon Sep 17 00:00:00 2001 From: cmsassot Date: Mon, 3 Oct 2022 16:42:01 +0200 Subject: [PATCH 1/3] hydra-saml: config list titre/description/option pour internationalisation --- defaults/main.yml | 5 +++-- templates/hydra-dispatcher-apps.yml.j2 | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index d7064be..22729af 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -110,12 +110,13 @@ hydra_passwordless_attributes_rewrite_rules: # Hydra SAML configuration enable_hydra_saml: yes -hydra_saml_app_title: SAML -hydra_saml_app_description: Authentification via SAML +hydra_saml_app_title: {} +hydra_saml_app_description: {} hydra_saml_app_icon_url: hydra_saml_identity_provider_id: saml hydra_saml_idp_entity_id: https://samltest.id/saml/idp hydra_saml_idp_metadata_url: https://samltest.id/saml/idp +hydra_saml_app_options: {} # Liste des URLs autorisées pour la redirection post-login/logout sur le service shibboleth-sp hydra_saml_allowed_redirects: [] diff --git a/templates/hydra-dispatcher-apps.yml.j2 b/templates/hydra-dispatcher-apps.yml.j2 index 02a2926..bc63b93 100644 --- a/templates/hydra-dispatcher-apps.yml.j2 +++ b/templates/hydra-dispatcher-apps.yml.j2 @@ -16,14 +16,21 @@ hydra: {% if enable_hydra_saml %} - id: {{ hydra_saml_identity_provider_id | default("saml") }} title: - fr: "{{ hydra_saml_app_title }}" + fr: "{{ hydra_saml_app_title.fr }}" + en: "{{ hydra_saml_app_title.en | default("{{ hydra_saml_app_title.fr }}") }}" description: - fr: "{{ hydra_saml_app_description }}" + fr: "{{ hydra_saml_app_description.fr }}" + en: "{{ hydra_saml_app_description.en | default("{{ hydra_saml_app_description.fr }}") }}" login_url: "{{ haproxy_public_base_url }}{{ haproxy_hydra_saml_base_path }}/login" consent_url: "{{ haproxy_public_base_url }}{{ haproxy_hydra_saml_base_path }}/consent" logout_url: "{{ haproxy_public_base_url }}{{ haproxy_hydra_saml_base_path }}/logout" attributes_rewrite_rules: {{ hydra_saml_attributes_rewrite_rules | to_json }} icon_url: "{{ hydra_saml_app_icon_url }}" + options: + icon_url: + fr: "{{ hydra_saml_app_options.icon_url.fr }}" + en: "{{ hydra_saml_app_options.icon_url.en | default("{{ hydra_saml_app_options.icon_url.fr }}") }}" + {% endif %} {% if enable_hydra_oidc %} - id: {{ hydra_oidc_identity_provider_id | default("oidc") }} -- 2.17.1 From 53b65d7f192c1b0f7a37aa16366b1eb97d629045 Mon Sep 17 00:00:00 2001 From: cmsassot Date: Mon, 3 Oct 2022 16:42:14 +0200 Subject: [PATCH 2/3] hydra-oidc: config list titre/description/option pour internationalisation --- defaults/main.yml | 6 +++--- templates/hydra-dispatcher-apps.yml.j2 | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 22729af..c9a8fda 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -188,8 +188,8 @@ oidc_test_app_public_base_url: "{{ haproxy_public_base_url }}{{ haproxy_oidc_tes enable_hydra_oidc: no hydra_oidc_debug: no hydra_oidc_cookie_path: "{{ haproxy_hydra_oidc_base_path }}" -hydra_oidc_app_title: OpenID Connect -hydra_oidc_app_description: Authentification via OpenID Connect +hydra_oidc_app_title: {} +hydra_oidc_app_description: {} hydra_oidc_app_icon_url: https://openid.net/wordpress-content/uploads/2014/09/openid-r-logo-900x360.png hydra_oidc_identity_provider_id: oidc hydra_oidc_authorize_endpoint: @@ -201,7 +201,7 @@ hydra_oidc_scope: openid email hydra_oidc_client_id: hydra_oidc_client_secret: hydra_oidc_additionnal_env: {} - +hydra_oidc_app_options: {} hydra_oidc_attributes_rewrite_rules: email: - "property_exists(consent.session.id_token, 'email') ? consent.session.id_token.email : null" diff --git a/templates/hydra-dispatcher-apps.yml.j2 b/templates/hydra-dispatcher-apps.yml.j2 index bc63b93..904b904 100644 --- a/templates/hydra-dispatcher-apps.yml.j2 +++ b/templates/hydra-dispatcher-apps.yml.j2 @@ -35,14 +35,20 @@ hydra: {% if enable_hydra_oidc %} - id: {{ hydra_oidc_identity_provider_id | default("oidc") }} title: - fr: "{{ hydra_oidc_app_title }}" + fr: "{{ hydra_oidc_app_title.fr }}" + en: "{{ hydra_oidc_app_title.en | default("{{ hydra_oidc_app_title.fr }}") }}" description: - fr: "{{ hydra_oidc_app_description }}" + fr: "{{ hydra_oidc_app_description.fr }}" + en: "{{ hydra_oidc_app_description.en | default("{{ hydra_oidc_app_description.fr }}") }}" login_url: "{{ haproxy_public_base_url }}{{ haproxy_hydra_oidc_base_path }}/login" consent_url: "{{ haproxy_public_base_url }}{{ haproxy_hydra_oidc_base_path }}/consent" logout_url: "{{ haproxy_public_base_url }}{{ haproxy_hydra_oidc_base_path }}/logout" attributes_rewrite_rules: {{ hydra_oidc_attributes_rewrite_rules | to_json }} icon_url: "{{ hydra_oidc_app_icon_url }}" + options: + icon_url: + fr: "{{ hydra_oidc_app_options.icon_url.fr }}" + en: "{{ hydra_oidc_app_options.icon_url.en | default("{{ hydra_oidc_app_options.icon_url.fr }}") }}" {% endif %} {% if enable_hydra_ldap %} - id: ldap -- 2.17.1 From 6830dd36b9ac56b14051d56549b8b8ec1f612bb5 Mon Sep 17 00:00:00 2001 From: cmsassot Date: Thu, 27 Oct 2022 10:38:26 +0200 Subject: [PATCH 3/3] hydra-dispatcher: update templating j2 --- templates/cadoles-pod-hydra-dispatcher-v1.conf.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/cadoles-pod-hydra-dispatcher-v1.conf.j2 b/templates/cadoles-pod-hydra-dispatcher-v1.conf.j2 index 2459f4f..7b41211 100644 --- a/templates/cadoles-pod-hydra-dispatcher-v1.conf.j2 +++ b/templates/cadoles-pod-hydra-dispatcher-v1.conf.j2 @@ -5,10 +5,6 @@ PODMAN_ARGS="\ --network=slirp4netns:allow_host_loopback=true \ --tz=local \ -p 127.0.0.1:3000:80 \ - -v /etc/hydra-dispatcher/conf.d:/var/www/config/hydra \ - {% for item in hydra_dispatcher_mounts %} - -v '{{ item.host }}:{{ item.container }}' \ - {% endfor %} -e APP_ENV=prod \ -e 'APP_DEBUG={{ hydra_dispatcher_debug }}' \ -e HYDRA_ADMIN_BASE_URL=http://10.0.2.2:4445 \ @@ -24,4 +20,8 @@ PODMAN_ARGS="\ -e 'TRUSTED_PROXIES=127.0.0.1,10.0.2.0/24' \ -e 'SENTRY_DSN={{ hydra_dispatcher_sentry_dsn }}' \ -e 'SENTRY_ENVIRONMENT={{ hydra_dispatcher_sentry_environment }}' \ + -v /etc/hydra-dispatcher/conf.d:/var/www/config/hydra \ + {% for item in hydra_dispatcher_mounts %} + -v {{ item.host }}:{{ item.container }} \ + {% endfor %} " \ No newline at end of file -- 2.17.1