From 20b6637a4394a89e4caea7bc8de176b656d2e00a Mon Sep 17 00:00:00 2001 From: Martin Rohrmeier Date: Thu, 12 Sep 2024 09:05:35 +0200 Subject: [PATCH] feat(access): allow more flexible access checks (#873) --- CHANGELOG.md | 2 + index.html | 4 +- providers.html | 515 ++++++++++++++++++ scripts/inject-dynamic-env.sh | 4 +- src/components/AuthProvider.tsx | 35 -- .../CompanyCertificateDetails/index.tsx | 4 +- .../AdminCredentialElements.tsx | 4 +- .../components/AppDetailHeader/index.tsx | 18 +- .../components/AppListGroupView/index.tsx | 2 +- .../AppSubscriptionDetailOverlay/index.tsx | 4 +- .../components/AppUserDetailsTable/index.tsx | 6 +- .../CompanyCertificateCard.tsx | 6 +- .../pages/CompanyCertificates/index.tsx | 4 +- .../CompanySubscriptionTechnical/index.tsx | 4 +- .../pages/CompanyWallet/RuleCard.tsx | 3 + .../EdcConnector/ConnectorDetailsOverlay.tsx | 4 +- .../pages/Home/components/MenuInfo/index.tsx | 2 +- src/components/pages/MyAccount/index.tsx | 17 +- .../Organization/MyCompanyInfoComponent.tsx | 4 +- .../pages/SemanticHub/ModelDetailDialog.tsx | 4 +- src/components/pages/SemanticHub/index.tsx | 4 +- .../components/MarketplaceHeader/index.tsx | 8 +- .../UserManagement/ActiveUserTable/index.tsx | 6 +- .../StageSubNavigation/StageSubNavigation.tsx | 4 +- .../shared/basic/KeyValueView/index.tsx | 27 +- src/components/shared/frame/Header/index.tsx | 8 +- src/features/store.ts | 2 - src/features/user/slice.ts | 48 -- src/features/user/types.ts | 33 -- src/index.tsx | 7 +- src/services/AccessService.tsx | 61 ++- src/services/EnvironmentService.ts | 6 + src/services/UserService.ts | 88 +-- src/types/Config.tsx | 183 ++++--- src/types/Constants.ts | 4 +- src/types/MainTypes.ts | 16 +- .../{multiMapBy.test.ts => dataUtils.test.ts} | 48 +- src/utils/{multiMapBy.ts => dataUtils.ts} | 21 + 38 files changed, 837 insertions(+), 383 deletions(-) create mode 100644 providers.html delete mode 100644 src/components/AuthProvider.tsx delete mode 100644 src/features/user/slice.ts delete mode 100644 src/features/user/types.ts rename src/utils/{multiMapBy.test.ts => dataUtils.test.ts} (78%) rename src/utils/{multiMapBy.ts => dataUtils.ts} (77%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bfa4a542..2b3a0efb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Feature +- **Roles and Permissions** + - Enable more fine grained permission checks by client id and roles - **Customer Detail Data Overlay** - implement new UI design for customer detail data overlay - **Company Subscription Management** diff --git a/index.html b/index.html index 1a72c3909..ef42715e5 100644 --- a/index.html +++ b/index.html @@ -29,8 +29,8 @@
- \ No newline at end of file + diff --git a/providers.html b/providers.html new file mode 100644 index 000000000..fdf3299e0 --- /dev/null +++ b/providers.html @@ -0,0 +1,515 @@ +const data = [ + { + "name": "CX-Operator", + "alias": "CX-Operator", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/CX-Operator/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Uniper SE", + "alias": "idp2", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp2/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Krones AG", + "alias": "idp3", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp3/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "MAN SE", + "alias": "idp4", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp4/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SOH Dataspace AG", + "alias": "idp6", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp6/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Krones Dup AG", + "alias": "idp7", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp7/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Resöüt", + "alias": "idp8", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp8/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "4zero Solutions GmbH", + "alias": "idp9", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp9/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Saller GmbH", + "alias": "idp18", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp18/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Arnsburg Apotheke "Alte Bornheimer Apotheke" e.K.", + "alias": "idp19", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp19/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Automotive Cells Co", + "alias": "idp20", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp20/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SAP Deutschland SE & Co. KG", + "alias": "idp21", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp21/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Continental Automotive Technologies GmbH", + "alias": "idp22", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp22/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SAP France", + "alias": "idp23", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp23/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SAP Italia S.p.A.", + "alias": "idp24", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp24/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SAP Österreich GmbH", + "alias": "idp25", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp25/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Covestro Deutschland AG", + "alias": "idp26", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp26/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SAP SE", + "alias": "idp27", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp27/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Schaeffler AG", + "alias": "idp28", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp28/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Schaeffler Technologies AG & Co. KG", + "alias": "idp29", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp29/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Schaeffler Engineering GmbH", + "alias": "idp30", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp30/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "DatafabriQ UG", + "alias": "idp31", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp31/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "B. Fischer AG", + "alias": "idp32", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp32/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Siemens Advanta Solutions GmbH", + "alias": "idp33", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp33/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Delos Cloud GmbH", + "alias": "idp34", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp34/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "BASF Digital Solutions S.L.U.", + "alias": "idp35", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp35/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "BASF SE", + "alias": "idp36", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp36/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Denso Automotive Deutschland GmbH", + "alias": "idp37", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp37/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "BloqSens AG", + "alias": "idp38", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp38/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "DENSO CORPORATION", + "alias": "idp39", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp39/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "BMW AG", + "alias": "idp40", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp40/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "HELLA GmbH & Co. KGaA", + "alias": "idp41", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp41/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Detecon International GmbH", + "alias": "idp42", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp42/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Capgemini Deutschland GmbH", + "alias": "idp43", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp43/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "CatX Service GmbH", + "alias": "idp44", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp44/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Eberspächer Controls Esslingen GmbH & Co. KG", + "alias": "idp45", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp45/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Hirschmann Automotive GmbH", + "alias": "idp46", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp46/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Siemens AG", + "alias": "idp47", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp47/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "EJOT SE & Co. KG", + "alias": "idp48", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp48/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Hybris GmbH", + "alias": "idp49", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp49/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Flex Automotive GmbH", + "alias": "idp50", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp50/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Siemens Industry Software GmbH", + "alias": "idp51", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp51/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "sovity GmbH", + "alias": "idp54", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp54/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SK Inc.", + "alias": "idp55", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp55/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Ford Werke GmbH", + "alias": "idp56", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp56/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Forvia", + "alias": "idp57", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp57/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Spherity GmbH", + "alias": "idp58", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp58/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "FORD ESPANA SL", + "alias": "idp52", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp52/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "IAV GmbH Ingenieurgesellschaft Auto und Verkehr", + "alias": "idp53", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp53/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "IBM Deutschland GmbH", + "alias": "idp59", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp59/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Light ds GmbH", + "alias": "idp60", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp60/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SSC-Services GmbH", + "alias": "idp61", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp61/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "German Edge Cloud GmbH & Co. KG", + "alias": "idp62", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp62/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Stellantis N.V.", + "alias": "idp63", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp63/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Lisa Dräxlmaier GmbH", + "alias": "idp64", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp64/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Harman Becker Automotive Systems GmbH", + "alias": "idp65", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp65/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "SupplyOn AG", + "alias": "idp66", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp66/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Trebing & Himstedt Prozeßautomation GmbH & Co. KG", + "alias": "idp67", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp67/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "T-Systems International GmbH", + "alias": "idp68", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp68/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Volkswagen AG", + "alias": "idp69", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp69/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "WITTE Automotive GmbH", + "alias": "idp70", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp70/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "ZF Friedrichshafen AG", + "alias": "idp71", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp71/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Antipodean GmbH", + "alias": "idp72", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp72/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Magna International (Germany) GmbH", + "alias": "idp73", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp73/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "AROMA GLOBAL 3 d.o.o", + "alias": "idp74", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp74/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "MAHLE International GmbH", + "alias": "idp75", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp75/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Materna Information & Communications SE", + "alias": "idp76", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp76/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Mercedes-Benz Group AG", + "alias": "idp77", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp77/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "MHP Management- und IT-Beratung GmbH", + "alias": "idp78", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp78/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "NTT Communications Corporation", + "alias": "idp79", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp79/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "NTT Germany", + "alias": "idp80", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp80/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "NTT Luxembourg PSF SA", + "alias": "idp81", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp81/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "NTT Netherlands B.V.", + "alias": "idp82", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp82/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "OETINGER Aluminum GmbH", + "alias": "idp83", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp83/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Polygran GmbH", + "alias": "idp84", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp84/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Pöppelmann Kunststoff-Technik GmbH & Co. KG", + "alias": "idp85", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp85/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Contemporary Amperex Technology", + "alias": "idp86", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp86/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Renault SAS", + "alias": "idp87", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp87/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "RenewEarth Lab Inc", + "alias": "idp88", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp88/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Franke Holding AG", + "alias": "idp89", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp89/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Rhenus Automotive SE", + "alias": "idp90", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp90/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "RITTAL GmbH & Co. KG", + "alias": "idp91", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp91/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Robert Bosch GmbH", + "alias": "idp92", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp92/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "Robert Bosch Manufacturing Solutions GmbH", + "alias": "idp93", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp93/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + { + "name": "S1Seven GmbH", + "alias": "idp94", + "provider": "keycloak-oidc", + "url": "/auth/realms/CX-Central/broker/idp94/login?client_id=Cl2-CX-Portal&tab_id=n0o38pB50y8&session_code=oWrl70zGNNgkCIaNN5nRuom6CuEu3DInyHI4Pn7e7AE" + }, + null +] + +console.log(data) \ No newline at end of file diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index 84de178ba..dfa698eb2 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -20,9 +20,9 @@ ############################################################### # Define custom variable -custom_env_vars='{REQUIRE_HTTPS_URL_PATTERN:"'$REQUIRE_HTTPS_URL_PATTERN'",PORTAL_ASSETS_URL:"'$PORTAL_ASSETS_URL'",PORTAL_BACKEND_URL:"'$PORTAL_BACKEND_URL'",CENTRALIDP_URL:"'$CENTRALIDP_URL'",SSI_CREDENTIAL_URL:"'$SSI_CREDENTIAL_URL'",BPDM_POOL_API_URL:"'$BPDM_POOL_API_URL'",BPDM_GATE_API_URL:"'$BPDM_GATE_API_URL'",SEMANTICS_URL:"'$SEMANTICS_URL'",MANAGED_IDENTITY_WALLETS_NEW_URL:"'$MANAGED_IDENTITY_WALLETS_NEW_URL'",REALM:"'$REALM'",CLIENT_ID:"'$CLIENT_ID'",CLIENT_ID_SEMANTIC:"'$CLIENT_ID_SEMANTIC'",CLIENT_ID_MIW:"'$CLIENT_ID_MIW'",CLIENT_ID_SSI_CREDENTIAL:"'$CLIENT_ID_SSI_CREDENTIAL'"}' +custom_env_vars='{REQUIRE_HTTPS_URL_PATTERN:"'$REQUIRE_HTTPS_URL_PATTERN'",PORTAL_ASSETS_URL:"'$PORTAL_ASSETS_URL'",PORTAL_BACKEND_URL:"'$PORTAL_BACKEND_URL'",CENTRALIDP_URL:"'$CENTRALIDP_URL'",SSI_CREDENTIAL_URL:"'$SSI_CREDENTIAL_URL'",BPDM_POOL_API_URL:"'$BPDM_POOL_API_URL'",BPDM_GATE_API_URL:"'$BPDM_GATE_API_URL'",SEMANTICS_URL:"'$SEMANTICS_URL'",MANAGED_IDENTITY_WALLETS_NEW_URL:"'$MANAGED_IDENTITY_WALLETS_NEW_URL'",REALM:"'$REALM'",CLIENT_ID:"'$CLIENT_ID'",CLIENT_ID_REGISTRATION:"'$CLIENT_ID_REGISTRATION'",CLIENT_ID_SEMANTIC:"'$CLIENT_ID_SEMANTIC'",CLIENT_ID_BPDM:"'$CLIENT_ID_BPDM'",CLIENT_ID_MIW:"'$CLIENT_ID_MIW'",CLIENT_ID_SSI_CREDENTIAL:"'$CLIENT_ID_SSI_CREDENTIAL'"}' # Define anchor variable -custom_env_vars_anchor='{REQUIRE_HTTPS_URL_PATTERN:"true",PORTAL_ASSETS_URL:"http://localhost:3000/assets",PORTAL_BACKEND_URL:"https://portal-backend.example.org",CENTRALIDP_URL:"https://centralidp.example.org/auth",SSI_CREDENTIAL_URL:"https://ssi-credential-issuer.example.org",BPDM_POOL_API_URL:"https://business-partners.example.org/pool/v6",BPDM_GATE_API_URL:"https://business-partners.example.org/companies/test-company/v6",SEMANTICS_URL:"https://semantics.example.org",MANAGED_IDENTITY_WALLETS_NEW_URL:"https://managed-identity-wallets-new.example.org",REALM:"CX-Central",CLIENT_ID:"Cl2-CX-Portal",CLIENT_ID_SEMANTIC:"Cl3-CX-Semantic",CLIENT_ID_MIW:"Cl5-CX-Custodian",CLIENT_ID_SSI_CREDENTIAL:"Cl24-CX-SSI-CredentialIssuer"}' +custom_env_vars_anchor='{REQUIRE_HTTPS_URL_PATTERN:"true",PORTAL_ASSETS_URL:"http://localhost:3000/assets",PORTAL_BACKEND_URL:"https://portal-backend.example.org",CENTRALIDP_URL:"https://centralidp.example.org/auth",SSI_CREDENTIAL_URL:"https://ssi-credential-issuer.example.org",BPDM_POOL_API_URL:"https://business-partners.example.org/pool/v6",BPDM_GATE_API_URL:"https://business-partners.example.org/companies/test-company/v6",SEMANTICS_URL:"https://semantics.example.org",MANAGED_IDENTITY_WALLETS_NEW_URL:"https://managed-identity-wallets-new.example.org",REALM:"CX-Central",CLIENT_ID:"Cl2-CX-Portal",CLIENT_ID_REGISTRATION:"Cl1-CX-Registration",CLIENT_ID_SEMANTIC:"Cl3-CX-Semantic",CLIENT_ID_BPDM:"Cl7-CX-BPDM",CLIENT_ID_MIW:"Cl5-CX-Custodian",CLIENT_ID_SSI_CREDENTIAL:"Cl24-CX-SSI-CredentialIssuer"}' # Read content of the reference index.html file into the index_html_reference variable index_html_reference=`cat /usr/share/nginx/html/index.html.reference` # Replace the anchor variable with the custom variable in the index.html file diff --git a/src/components/AuthProvider.tsx b/src/components/AuthProvider.tsx deleted file mode 100644 index 75fc2f080..000000000 --- a/src/components/AuthProvider.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 BMW Group AG - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { useEffect } from 'react' -import { useDispatch } from 'react-redux' -import { setLoggedUser } from 'features/user/slice' -import type { IUser } from 'features/user/types' - -export function AuthProvider(props: { - children: JSX.Element - user: IUser -}): JSX.Element { - const dispatch = useDispatch() - useEffect(() => { - dispatch(setLoggedUser(props.user)) - }, [dispatch, props.user]) - return <>{props.children} -} diff --git a/src/components/overlays/CompanyCertificateDetails/index.tsx b/src/components/overlays/CompanyCertificateDetails/index.tsx index 8bd3e5d84..7391f37df 100644 --- a/src/components/overlays/CompanyCertificateDetails/index.tsx +++ b/src/components/overlays/CompanyCertificateDetails/index.tsx @@ -46,8 +46,8 @@ import { useEffect, useState } from 'react' import { OVERLAYS, ROLES } from 'types/Constants' import dayjs from 'dayjs' import LoadingProgress from 'components/shared/basic/LoadingProgress' -import UserService from 'services/UserService' import { SortType } from 'components/pages/CompanyCertificates' +import { userHasPortalRole } from 'services/AccessService' export enum StatusTag { PENDING = 'Pending', @@ -209,7 +209,7 @@ export default function CompanyCertificateDetails({