From 7262ab4845947705e1fbeee4059b172a21a6d744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Dubigny?= Date: Fri, 25 Oct 2024 11:41:21 +0200 Subject: [PATCH] feat: update all occurences of 'MonComptePro' --- .env | 12 ++++++------ .github/workflows/publish.yml | 2 +- README.md | 14 +++++++------- agentconnect.env | 12 ++++++------ e2e/cypress.config.ts | 2 +- e2e/features/connexion.feature | 6 +++--- e2e/features/connexion.ts | 12 ++++++------ index.js | 14 +++++++------- package-lock.json | 4 ++-- package.json | 10 +++++----- publishing.md | 4 ++-- views/index.ejs | 4 ++-- 12 files changed, 48 insertions(+), 48 deletions(-) diff --git a/.env b/.env index 7b9286a..97a648b 100644 --- a/.env +++ b/.env @@ -3,13 +3,13 @@ PORT: 3000 SITE_TITLE: "Bonjour monde !" STYLESHEET_URL: https://unpkg.com/bamboo.css CALLBACK_URL: /login-callback -MCP_CLIENT_ID: client_id -MCP_CLIENT_SECRET: client_secret -MCP_PROVIDER: https://app-sandbox.moncomptepro.beta.gouv.fr/ -MCP_SCOPES: "openid email profile organization" +PC_CLIENT_ID: client_id +PC_CLIENT_SECRET: client_secret +PC_PROVIDER: https://app-sandbox.moncomptepro.beta.gouv.fr/ +PC_SCOPES: "openid email profile organization" LOGIN_HINT: "" -MCP_ID_TOKEN_SIGNED_RESPONSE_ALG: RS256 -MCP_USERINFO_SIGNED_RESPONSE_ALG: "" +PC_ID_TOKEN_SIGNED_RESPONSE_ALG: RS256 +PC_USERINFO_SIGNED_RESPONSE_ALG: "" ACR_VALUES: "" SESSION_SECRET: CeciEstUnFauxSecret ACR_VALUE_FOR_2FA: "https://proconnect.gouv.fr/assurance/consistency-checked-2fa" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dfd3247..509c171 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,7 +29,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ghcr.io/numerique-gouv/moncomptepro-test-client + images: ghcr.io/numerique-gouv/proconnect-test-client tags: | type=sha,format=long,prefix= type=ref,event=branch diff --git a/README.md b/README.md index 1cfeeaf..196143f 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -# MonComptePro Test Client +# ProConnect Test Client -This is a minimal, nodeJS-based MonComptePro client, to be used for end-to-end testing. +This is a minimal, nodeJS-based ProConnect client, to be used for end-to-end testing. It uses the https://github.com/panva/node-openid-client Library for the actual OIDC Logic. This tool can be used to test the traditional Authorization Code Flow. -It also uses the `select_organization` & `update_userinfo` MonComptePro prompts. +It also uses the `select_organization` & `update_userinfo` ProConnect prompts (available only on ProConnect Identité). -This tool is full configured using environment variables. +This tool is fully configured using environment variables. ## Run it with Docker Pull the image: ``` -docker pull ghcr.io/numerique-gouv/moncomptepro-test-client +docker pull ghcr.io/numerique-gouv/proconnect-test-client ``` Run the container: @@ -24,7 +24,7 @@ Run the container: docker run --rm \ -p 3000:3000 \ -e PORT=3000 \ -ghcr.io/numerique-gouv/moncomptepro-test-client +ghcr.io/numerique-gouv/proconnect-test-client ``` ## Run it with Docker Compose @@ -36,7 +36,7 @@ version: "3.5" services: oidc-test-client: - image: rdubigny/moncomptepro-test-client + image: numerique-gouv/proconnect-test-client ports: - 3000:3000 environment: diff --git a/agentconnect.env b/agentconnect.env index 88b8014..de6f33b 100644 --- a/agentconnect.env +++ b/agentconnect.env @@ -3,13 +3,13 @@ PORT: 3000 SITE_TITLE: "Bonjour monde !" STYLESHEET_URL: https://unpkg.com/bamboo.css CALLBACK_URL: /login-callback -MCP_CLIENT_ID: client_id_localhost:3000 -MCP_CLIENT_SECRET: client_secret_localhost:3000 -MCP_PROVIDER: https://fca.integ01.dev-agentconnect.fr/api/v2 -MCP_SCOPES: "openid given_name usual_name email phone uid siren siret idp_id idp_acr is_public_service" +PC_CLIENT_ID: client_id_localhost:3000 +PC_CLIENT_SECRET: client_secret_localhost:3000 +PC_PROVIDER: https://fca.integ01.dev-agentconnect.fr/api/v2 +PC_SCOPES: "openid given_name usual_name email phone uid siren siret idp_id idp_acr is_public_service" LOGIN_HINT: "" -MCP_ID_TOKEN_SIGNED_RESPONSE_ALG: RS256 -MCP_USERINFO_SIGNED_RESPONSE_ALG: RS256 +PC_ID_TOKEN_SIGNED_RESPONSE_ALG: RS256 +PC_USERINFO_SIGNED_RESPONSE_ALG: RS256 ACR_VALUES: eidas1 SESSION_SECRET: CeciEstUnFauxSecret SHOW_AGENTCONNECT_BUTTON: true diff --git a/e2e/cypress.config.ts b/e2e/cypress.config.ts index ed98318..b73dec3 100644 --- a/e2e/cypress.config.ts +++ b/e2e/cypress.config.ts @@ -17,7 +17,7 @@ export default defineConfig({ supportFile: false, }, env: { - MCP_PROVIDER: process.env.MCP_PROVIDER, + PC_PROVIDER: process.env.PC_PROVIDER, }, }); diff --git a/e2e/features/connexion.feature b/e2e/features/connexion.feature index 9fbb28e..e24a6e7 100644 --- a/e2e/features/connexion.feature +++ b/e2e/features/connexion.feature @@ -6,9 +6,9 @@ Fonctionnalité: Connexion de user@yopmail.com Alors je vois "Bonjour monde !" Quand je clique sur le bouton ProConnect - Quand je me connecte en tant que user@yopmail.com sur moncomptepro - Et je vois "Votre organisation de rattachement" sur moncomptepro - Et je clique sur "Continuer" sur moncomptepro + Quand je me connecte en tant que user@yopmail.com sur ProConnect + Et je vois "Votre organisation de rattachement" sur ProConnect + Et je clique sur "Continuer" sur ProConnect Alors je suis redirigé sur "/" Et je vois "Information utilisateur" diff --git a/e2e/features/connexion.ts b/e2e/features/connexion.ts index 2455a32..13fecb1 100644 --- a/e2e/features/connexion.ts +++ b/e2e/features/connexion.ts @@ -22,22 +22,22 @@ Then("je vois {string}", function (text: string) { // -When("je vois {string} sur moncomptepro", (_text: string) => { - cy.origin(Cypress.env("MCP_PROVIDER"), { args: _text }, (text) => { +When("je vois {string} sur ProConnect", (_text: string) => { + cy.origin(Cypress.env("PC_PROVIDER"), { args: _text }, (text) => { cy.contains(text); }); }); -When("je clique sur {string} sur moncomptepro", (_text: string) => { - cy.origin(Cypress.env("MCP_PROVIDER"), { args: _text }, (text) => { +When("je clique sur {string} sur ProConnect", (_text: string) => { + cy.origin(Cypress.env("PC_PROVIDER"), { args: _text }, (text) => { cy.contains(text).click(); }); }); When( - "je me connecte en tant que user@yopmail.com sur moncomptepro", + "je me connecte en tant que user@yopmail.com sur ProConnect", (path: string) => { - cy.origin(Cypress.env("MCP_PROVIDER"), () => { + cy.origin(Cypress.env("PC_PROVIDER"), () => { cy.get('[name="login"]').type("user@yopmail.com"); cy.get('[type="submit"]').click(); diff --git a/index.js b/index.js index cb3e21d..7547668 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ const app = express(); app.set("view engine", "ejs"); app.use( session({ - name: "mcp_session", + name: "pc_session", secret: process.env.SESSION_SECRET, rolling: true, }), @@ -25,16 +25,16 @@ app.use(morgan("combined")); const removeNullValues = (obj) => Object.entries(obj).reduce((a,[k,v]) => (v ? (a[k]=v, a) : a), {}) const getMcpClient = async () => { - const mcpIssuer = await Issuer.discover(process.env.MCP_PROVIDER); + const mcpIssuer = await Issuer.discover(process.env.PC_PROVIDER); return new mcpIssuer.Client({ - client_id: process.env.MCP_CLIENT_ID, - client_secret: process.env.MCP_CLIENT_SECRET, + client_id: process.env.PC_CLIENT_ID, + client_secret: process.env.PC_CLIENT_SECRET, redirect_uris: [redirectUri], response_types: ["code"], - id_token_signed_response_alg: process.env.MCP_ID_TOKEN_SIGNED_RESPONSE_ALG, + id_token_signed_response_alg: process.env.PC_ID_TOKEN_SIGNED_RESPONSE_ALG, userinfo_signed_response_alg: - process.env.MCP_USERINFO_SIGNED_RESPONSE_ALG || null, + process.env.PC_USERINFO_SIGNED_RESPONSE_ALG || null, }); }; @@ -42,7 +42,7 @@ const acr_values = process.env.ACR_VALUES ? process.env.ACR_VALUES.split(",") : null; const login_hint = process.env.LOGIN_HINT || null; -const scope = process.env.MCP_SCOPES; +const scope = process.env.PC_SCOPES; const AUTHORIZATION_DEFAULT_PARAMS = { scope, login_hint, diff --git a/package-lock.json b/package-lock.json index 9f77fe8..b240a09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "moncomptepro-test-client", + "name": "proconnect-test-client", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "moncomptepro-test-client", + "name": "proconnect-test-client", "version": "1.0.0", "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 495b051..b9dda26 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { - "name": "moncomptepro-test-client", + "name": "proconnect-test-client", "version": "1.0.0", - "description": "This is a minimal, nodeJS-based MonComptePro client, to be used for end-to-end testing.", - "homepage": "https://github.com/rdubigny/moncomptepro-test-client#readme", + "description": "This is a minimal, nodeJS-based ProConnect client, to be used for end-to-end testing.", + "homepage": "https://github.com/numerique-gouv/proconnect-test-client#readme", "bugs": { - "url": "https://github.com/rdubigny/moncomptepro-test-client/issues" + "url": "https://github.com/numerique-gouv/proconnect-test-client/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/rdubigny/moncomptepro-test-client.git" + "url": "git+https://github.com/numerique-gouv/proconnect-test-client.git" }, "license": "AGPL-3.0", "author": "", diff --git a/publishing.md b/publishing.md index e10e0f2..ae30aba 100644 --- a/publishing.md +++ b/publishing.md @@ -1,7 +1,7 @@ # Publishing docker image ``` -docker build -t numerique-gouv/moncomptepro-test-client . +docker build -t numerique-gouv/proconnect-test-client . ``` Authenticate to the github docker registery: @@ -11,5 +11,5 @@ https://docs.github.com/en/packages/working-with-a-github-packages-registry/work Then ``` -docker push ghcr.io/numerique-gouv/moncomptepro-test-client +docker push ghcr.io/numerique-gouv/proconnect-test-client ``` diff --git a/views/index.ejs b/views/index.ejs index d62357f..4278b02 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -3,7 +3,7 @@ - <%= locals.title %> - MonComptePro + <%= locals.title %> - ProConnect