From ee085550f44a8898458993b58744cce435baa92f Mon Sep 17 00:00:00 2001 From: Loup Theron Date: Wed, 23 Oct 2024 11:13:39 +0200 Subject: [PATCH] Fix env var naming --- Makefile | 2 +- .../kotlin/fr/gouv/cnsp/monitorfish/config/OIDCProperties.kt | 2 +- .../infrastructure/api/proxy/KeycloakProxyController.kt | 2 +- infra/docker/docker-compose.cypress.yml | 4 ++-- infra/docker/docker-compose.puppeteer.yml | 2 ++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f38809866d..dce61fea6f 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ install-front: .PHONY: run-back ##LOCAL ▶️ Run backend API run-back: run-stubbed-apis docker compose up -d --quiet-pull --wait db keycloak - cd backend && MONITORFISH_KEYCLOAK_PROXY_ENABLED=true ./gradlew bootRun --args='--spring.profiles.active=local --spring.config.additional-location=$(INFRA_FOLDER)' + cd backend && MONITORFISH_KEYCLOAK_PROXY_ENABLED=true FRONTEND_OIDC_PROXY_URL=http://localhost:8085 ./gradlew bootRun --args='--spring.profiles.active=local --spring.config.additional-location=$(INFRA_FOLDER)' .PHONY: run-front ##LOCAL ▶️ Run frontend for development run-front: diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/config/OIDCProperties.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/config/OIDCProperties.kt index 2211e0f622..1a2ddbb427 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/config/OIDCProperties.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/config/OIDCProperties.kt @@ -9,5 +9,5 @@ class OIDCProperties { var enabled: Boolean? = false var userinfoEndpoint: String? = null var issuerUri: String? = null - var proxyURL: String? = null + var proxyUrl: String? = null } diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/proxy/KeycloakProxyController.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/proxy/KeycloakProxyController.kt index 4e67f59a52..600cf4981b 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/proxy/KeycloakProxyController.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/proxy/KeycloakProxyController.kt @@ -28,7 +28,7 @@ class KeycloakProxyController ( request: HttpServletRequest, ): ResponseEntity<*> { val params = request.parameterMap - val targetUri = StringBuilder("${oidcProperties.proxyURL}/${request.requestURI}") + val targetUri = StringBuilder("${oidcProperties.proxyUrl}/${request.requestURI}") if (params.isNotEmpty()) { targetUri.append("?") diff --git a/infra/docker/docker-compose.cypress.yml b/infra/docker/docker-compose.cypress.yml index d1fcd57911..93dfdf02d7 100644 --- a/infra/docker/docker-compose.cypress.yml +++ b/infra/docker/docker-compose.cypress.yml @@ -41,12 +41,12 @@ services: - FRONTEND_OIDC_AUTHORITY=http://0.0.0.0:8880/realms/monitor - FRONTEND_OIDC_CLIENT_ID=monitorfish - MONITORFISH_OIDC_ENABLED=true - - FRONTEND_OIDC_ENABLED=true + - MONITORFISH_OIDC_PROXY_URL=http://keycloak:8085 - MONITORFISH_KEYCLOAK_PROXY_ENABLED=true + - FRONTEND_OIDC_ENABLED=true - MONITORFISH_SCHEDULING_ENABLED=false - FRONTEND_OIDC_REDIRECT_URI=http://0.0.0.0:8880 - FRONTEND_OIDC_LOGOUT_REDIRECT_URI=http://0.0.0.0:8880/login - - FRONTEND_OIDC_PROXY_URL=http://keycloak:8085 - FRONTEND_MONITORFISH_VERSION= - FRONTEND_SENTRY_DSN=https://a5f3272efa794bb9ada2ffea90f2fec5@sentry.incubateur.net/8 - FRONTEND_SENTRY_TRACING_ORIGINS= diff --git a/infra/docker/docker-compose.puppeteer.yml b/infra/docker/docker-compose.puppeteer.yml index 21327cee75..cdf2e7e5bb 100644 --- a/infra/docker/docker-compose.puppeteer.yml +++ b/infra/docker/docker-compose.puppeteer.yml @@ -58,6 +58,8 @@ services: - FRONTEND_OIDC_CLIENT_ID=monitorfish - MONITORFISH_OIDC_ENABLED=false - MONITORFISH_SCHEDULING_ENABLED=false + - MONITORFISH_OIDC_PROXY_URL=http://keycloak:8085 + - MONITORFISH_KEYCLOAK_PROXY_ENABLED=true - FRONTEND_OIDC_ENABLED=false - FRONTEND_OIDC_REDIRECT_URI=http://0.0.0.0:8880 - FRONTEND_OIDC_LOGOUT_REDIRECT_URI=http://0.0.0.0:8880/login