From b1ccb98f89934bcf4a48651680327c893a52c862 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Mon, 18 Dec 2023 22:12:17 -0800 Subject: [PATCH 1/5] fix(helm): added missing IDP_URL --- charts/puris/README.md | 1 + charts/puris/templates/frontend-deployment.yaml | 2 ++ charts/puris/values.yaml | 2 ++ frontend/.env | 8 ++++---- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/charts/puris/README.md b/charts/puris/README.md index 37026042..27da50fa 100644 --- a/charts/puris/README.md +++ b/charts/puris/README.md @@ -145,6 +145,7 @@ $ helm install puris --namespace puris --create-namespace . | frontend.puris.keycloak.disabled | bool | `true` | Disable the Keycloak integration. | | frontend.puris.keycloak.realm | string | `"Catena-X"` | Name of the Realm of the keycloak instance. | | frontend.puris.keycloak.redirectUrlFrontend | string | `"https://your-frontend-url.com"` | URL to use as keycloak redirect url. | +| frontend.puris.keycloak.url | string | `"https://idp.com/auth"` | The URL to the IDP that should be used. | | frontend.readinessProbe | object | `{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Checks if the pod is fully ready to operate | | frontend.readinessProbe.failureThreshold | int | `3` | Number of failures (threshold) for a readiness probe | | frontend.readinessProbe.initialDelaySeconds | int | `10` | Delay in seconds after which an initial readiness probe is checked | diff --git a/charts/puris/templates/frontend-deployment.yaml b/charts/puris/templates/frontend-deployment.yaml index 3b338f3e..d0afc1c9 100644 --- a/charts/puris/templates/frontend-deployment.yaml +++ b/charts/puris/templates/frontend-deployment.yaml @@ -56,6 +56,8 @@ spec: value: "test" - name: IDP_DISABLE value: "{{ .Values.frontend.puris.keycloak.disabled }}" + - name: IDP_URL + value: "{{ .Values.frontend.puris.keycloak.url }}" - name: IDP_REALM value: "{{ .Values.frontend.puris.keycloak.realm }}" - name: IDP_CLIENT_ID diff --git a/charts/puris/values.yaml b/charts/puris/values.yaml index b0898256..f5d77b67 100644 --- a/charts/puris/values.yaml +++ b/charts/puris/values.yaml @@ -190,6 +190,8 @@ frontend: keycloak: # -- Disable the Keycloak integration. disabled: true + # -- The URL to the IDP that should be used. + url: "https://idp.com/auth" # -- Name of the Realm of the keycloak instance. realm: "Catena-X" # -- Name of the client which is used for the application. diff --git a/frontend/.env b/frontend/.env index aad61513..aec1160c 100644 --- a/frontend/.env +++ b/frontend/.env @@ -10,8 +10,8 @@ VITE_ENDPOINT_CUSTOMER=stockView/customer?ownMaterialNumber= VITE_ENDPOINT_PARTNER_PRODUCT_STOCKS=stockView/partner-product-stocks?ownMaterialNumber= VITE_ENDPOINT_UPDATE_PARTNER_PRODUCT_STOCK=stockView/update-partner-product-stock?ownMaterialNumber= -VITE_IDP_DISABLE=true -VITE_IDP_URL=http://localhost:10081/ -VITE_IDP_REALM=Catena-X -VITE_IDP_CLIENT_ID=Cl3-PURIS +VITE_IDP_DISABLE=false +VITE_IDP_URL=https://centralidp.int.demo.catena-x.net +VITE_IDP_REALM=CX-Central +VITE_IDP_CLIENT_ID=idp180 VITE_IDP_REDIRECT_URL_FRONTEND=http://localhost:3000/ From d10c5f44102a76684ca222c7baa37325fae859db Mon Sep 17 00:00:00 2001 From: --show-origin Date: Mon, 18 Dec 2023 22:18:30 -0800 Subject: [PATCH 2/5] fix(docker compose): put cpus into brackets --- local/docker-compose-dev-postgres.yaml | 2 +- local/docker-compose.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/local/docker-compose-dev-postgres.yaml b/local/docker-compose-dev-postgres.yaml index c7f35097..047aa55e 100644 --- a/local/docker-compose-dev-postgres.yaml +++ b/local/docker-compose-dev-postgres.yaml @@ -40,7 +40,7 @@ services: resources: limits: memory: 512mb - cpus: 0.5 + cpus: '0.5' security_opt: - no-new-privileges:true diff --git a/local/docker-compose.yaml b/local/docker-compose.yaml index ecf5354a..f47db899 100644 --- a/local/docker-compose.yaml +++ b/local/docker-compose.yaml @@ -84,7 +84,7 @@ services: resources: limits: memory: 512mb - cpus: 0.5 + cpus: '0.5' security_opt: - no-new-privileges:true @@ -189,7 +189,7 @@ services: resources: limits: memory: 512mb - cpus: 0.5 + cpus: '0.5' security_opt: - no-new-privileges:true From 4ea749f03d157f8c0cde464755c92bbea75ae47b Mon Sep 17 00:00:00 2001 From: --show-origin Date: Wed, 20 Dec 2023 08:37:13 -0800 Subject: [PATCH 3/5] fix: reset frontend .env to local defaults --- frontend/.env | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/.env b/frontend/.env index aec1160c..aad61513 100644 --- a/frontend/.env +++ b/frontend/.env @@ -10,8 +10,8 @@ VITE_ENDPOINT_CUSTOMER=stockView/customer?ownMaterialNumber= VITE_ENDPOINT_PARTNER_PRODUCT_STOCKS=stockView/partner-product-stocks?ownMaterialNumber= VITE_ENDPOINT_UPDATE_PARTNER_PRODUCT_STOCK=stockView/update-partner-product-stock?ownMaterialNumber= -VITE_IDP_DISABLE=false -VITE_IDP_URL=https://centralidp.int.demo.catena-x.net -VITE_IDP_REALM=CX-Central -VITE_IDP_CLIENT_ID=idp180 +VITE_IDP_DISABLE=true +VITE_IDP_URL=http://localhost:10081/ +VITE_IDP_REALM=Catena-X +VITE_IDP_CLIENT_ID=Cl3-PURIS VITE_IDP_REDIRECT_URL_FRONTEND=http://localhost:3000/ From 6b38565cf4cbabf19ace6078a92eec2de7901b28 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Thu, 21 Dec 2023 07:32:25 -0800 Subject: [PATCH 4/5] fix(keycloak): changed redirect uris in realm to https --- local/keycloak/puris-config/Catena-X-realm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local/keycloak/puris-config/Catena-X-realm.json b/local/keycloak/puris-config/Catena-X-realm.json index 6f9a3415..ccf34774 100644 --- a/local/keycloak/puris-config/Catena-X-realm.json +++ b/local/keycloak/puris-config/Catena-X-realm.json @@ -413,8 +413,8 @@ "enabled" : true, "alwaysDisplayInConsole" : false, "clientAuthenticatorType" : "client-secret", - "redirectUris" : [ "http://localhost:3000/*" ], - "webOrigins" : [ "http://localhost:3000" ], + "redirectUris" : [ "https://localhost:3000/*" ], + "webOrigins" : [ "https://localhost:3000" ], "notBefore" : 0, "bearerOnly" : false, "consentRequired" : false, From cddd83fac1a6b5981183db81266a2e2daefa310b Mon Sep 17 00:00:00 2001 From: --show-origin Date: Thu, 21 Dec 2023 07:34:25 -0800 Subject: [PATCH 5/5] fix(AccessService): remove aboutLicense as card from navigation when idp disabled --- frontend/.env | 2 +- frontend/src/services/AccessService.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/.env b/frontend/.env index aad61513..7b19ccc1 100644 --- a/frontend/.env +++ b/frontend/.env @@ -14,4 +14,4 @@ VITE_IDP_DISABLE=true VITE_IDP_URL=http://localhost:10081/ VITE_IDP_REALM=Catena-X VITE_IDP_CLIENT_ID=Cl3-PURIS -VITE_IDP_REDIRECT_URL_FRONTEND=http://localhost:3000/ +VITE_IDP_REDIRECT_URL_FRONTEND=https://localhost:3000/ diff --git a/frontend/src/services/AccessService.js b/frontend/src/services/AccessService.js index cacaf7f7..c9e61f98 100644 --- a/frontend/src/services/AccessService.js +++ b/frontend/src/services/AccessService.js @@ -24,7 +24,10 @@ const getViewsWithAccess = () => { let views = []; if (!AuthenticationService.isEnabled) { - return ALL_ROUTES.filter(route=> route.name !== "Unauthorized"); + return ALL_ROUTES.filter( + (route) => + route.name !== "Unauthorized" && route.name !== "aboutLicense" + ); } ALL_ROUTES.forEach((item) => {