From 07f5cb40994f2783d721d5d1b0b6772f4c1b49c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Dubigny?= Date: Mon, 21 Oct 2024 18:05:25 +0200 Subject: [PATCH] refactor: removed dedicated clients as they are now configurable --- .github/workflows/end-to-end.yml | 14 +------------- .../env.conf | 0 .../fixtures.sql | 13 +------------ .../index.cy.ts | 11 +++++++---- docker-compose.yml | 13 ------------- 5 files changed, 9 insertions(+), 42 deletions(-) rename cypress/e2e/{signin_from_legacy_client => signin_with_legacy_scope}/env.conf (100%) rename cypress/e2e/{signin_from_legacy_client => signin_with_legacy_scope}/fixtures.sql (77%) rename cypress/e2e/{signin_from_legacy_client => signin_with_legacy_scope}/index.cy.ts (65%) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 76171306..35bc9ddd 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -45,10 +45,10 @@ jobs: - redirect_after_session_expiration - reset_password - set_info_after_account_provisioning - - signin_from_legacy_client - signin_from_proconnect_federation_client - signin_from_standard_client - signin_with_email_verification_renewal + - signin_with_legacy_scope - signin_with_magic_link - signin_with_right_acr - signin_with_totp @@ -86,18 +86,6 @@ jobs: STYLESHEET_URL: "" LOGIN_HINT: unused1@yopmail.com ACR_VALUES: eidas1 - moncomptepro-legacy-client: - image: ghcr.io/numerique-gouv/moncomptepro-test-client - ports: - - 4002:3000 - env: - SITE_TITLE: moncomptepro-legacy-client - HOST: http://localhost:4002 - MCP_CLIENT_ID: legacy_client_id - MCP_CLIENT_SECRET: legacy_client_secret - MCP_PROVIDER: ${{ env.MONCOMPTEPRO_HOST }} - MCP_SCOPES: openid email profile phone organizations - STYLESHEET_URL: "" redis: image: redis:7.2 ports: diff --git a/cypress/e2e/signin_from_legacy_client/env.conf b/cypress/e2e/signin_with_legacy_scope/env.conf similarity index 100% rename from cypress/e2e/signin_from_legacy_client/env.conf rename to cypress/e2e/signin_with_legacy_scope/env.conf diff --git a/cypress/e2e/signin_from_legacy_client/fixtures.sql b/cypress/e2e/signin_with_legacy_scope/fixtures.sql similarity index 77% rename from cypress/e2e/signin_from_legacy_client/fixtures.sql rename to cypress/e2e/signin_with_legacy_scope/fixtures.sql index cc6973df..f2e8748a 100644 --- a/cypress/e2e/signin_from_legacy_client/fixtures.sql +++ b/cypress/e2e/signin_with_legacy_scope/fixtures.sql @@ -23,17 +23,6 @@ INSERT INTO oidc_clients userinfo_signed_response_alg, id_token_signed_response_alg, authorization_signed_response_alg, introspection_signed_response_alg) VALUES - ('Oidc Test Client', - 'legacy_client_id', - 'legacy_client_secret', - ARRAY [ - 'http://localhost:4002/login-callback' - ], - ARRAY []::varchar[], - 'openid email profile phone organizations', - 'http://localhost:4002/', - 'MonComptePro test client. More info: https://github.com/numerique-gouv/moncomptepro-test-client.', - null, null, null, null), ('Oidc Test Client', 'standard_client_id', 'standard_client_secret', @@ -41,7 +30,7 @@ VALUES 'http://localhost:4000/login-callback' ], ARRAY []::varchar[], - 'openid email profile organization', + 'openid email profile phone organization organizations', 'http://localhost:4000/', 'MonComptePro test client. More info: https://github.com/numerique-gouv/moncomptepro-test-client.', null, null, null, null); diff --git a/cypress/e2e/signin_from_legacy_client/index.cy.ts b/cypress/e2e/signin_with_legacy_scope/index.cy.ts similarity index 65% rename from cypress/e2e/signin_from_legacy_client/index.cy.ts rename to cypress/e2e/signin_with_legacy_scope/index.cy.ts index d538b1d9..4502d4e6 100644 --- a/cypress/e2e/signin_from_legacy_client/index.cy.ts +++ b/cypress/e2e/signin_with_legacy_scope/index.cy.ts @@ -1,13 +1,16 @@ // -describe("sign-in from legacy client", () => { +describe("sign-in with legacy scope", () => { it("should sign-in", function () { - cy.visit("http://localhost:4002"); - cy.get("button.proconnect-button").click(); + cy.visit("http://localhost:4000"); + cy.setCustomParams({ + scope: "openid email profile phone organizations", + }); + cy.get("button#custom-connection").click({ force: true }); cy.login("unused1@yopmail.com"); - cy.contains("moncomptepro-legacy-client"); + cy.contains("moncomptepro-standard-client"); cy.contains("unused1@yopmail.com"); cy.contains("Commune de lamalou-les-bains"); diff --git a/docker-compose.yml b/docker-compose.yml index db47657d..52f9f39f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,19 +56,6 @@ services: ACR_VALUES: eidas1 network_mode: "host" - moncomptepro-legacy-client: - image: ghcr.io/numerique-gouv/moncomptepro-test-client - environment: - PORT: 4002 - SITE_TITLE: moncomptepro-legacy-client - HOST: http://localhost:4002 - MCP_CLIENT_ID: legacy_client_id - MCP_CLIENT_SECRET: legacy_client_secret - MCP_PROVIDER: http://localhost:3000 - MCP_SCOPES: openid email profile phone organizations - STYLESHEET_URL: - network_mode: "host" - maildev: image: soulteary/maildev network_mode: "host"