-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into certification-dirig…
…eant-step1
- Loading branch information
Showing
162 changed files
with
3,303 additions
and
1,787 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ env: | |
FEATURE_SEND_MAIL: "True" | ||
INSEE_CONSUMER_KEY: ${{ secrets.INSEE_CONSUMER_KEY }} | ||
INSEE_CONSUMER_SECRET: ${{ secrets.INSEE_CONSUMER_SECRET }} | ||
MONCOMPTEPRO_HOST: http://172.18.0.1:3000 | ||
HOST: http://172.18.0.1:3000 | ||
ZAMMAD_TOKEN: ${{ secrets.ZAMMAD_TOKEN }} | ||
jobs: | ||
test: | ||
|
@@ -67,7 +67,7 @@ jobs: | |
HOST: http://localhost:4000 | ||
PC_CLIENT_ID: standard_client_id | ||
PC_CLIENT_SECRET: standard_client_secret | ||
PC_PROVIDER: ${{ env.MONCOMPTEPRO_HOST }} | ||
PC_PROVIDER: ${{ env.HOST }} | ||
PC_SCOPES: openid email profile organization | ||
ACR_VALUE_FOR_2FA: https://proconnect.gouv.fr/assurance/consistency-checked-2fa | ||
STYLESHEET_URL: "" | ||
|
@@ -80,7 +80,7 @@ jobs: | |
HOST: http://localhost:4001 | ||
PC_CLIENT_ID: proconnect_federation_client_id | ||
PC_CLIENT_SECRET: proconnect_federation_client_secret | ||
PC_PROVIDER: ${{ env.MONCOMPTEPRO_HOST }} | ||
PC_PROVIDER: ${{ env.HOST }} | ||
PC_SCOPES: openid uid given_name usual_name email siren siret organizational_unit belonging_population phone chorusdt is_service_public is_public_service | ||
PC_ID_TOKEN_SIGNED_RESPONSE_ALG: ES256 | ||
PC_USERINFO_SIGNED_RESPONSE_ALG: ES256 | ||
|
@@ -92,7 +92,7 @@ jobs: | |
ports: | ||
- 6379:6379 | ||
postgres: | ||
image: postgres:15.8 | ||
image: postgres:15.10 | ||
env: | ||
POSTGRES_USER: ${{ env.PGUSER }} | ||
POSTGRES_PASSWORD: ${{ env.PGPASSWORD }} | ||
|
@@ -108,15 +108,15 @@ jobs: | |
with: | ||
cache: "npm" | ||
node-version-file: package.json | ||
- run: npm ci --include=dev | ||
- run: npm ci | ||
- run: npm run build:workspaces | ||
- run: npm run migrate up | ||
- run: npm run fixtures:load-ci -- cypress/e2e/${{ matrix.e2e_test }}/fixtures.sql | ||
- run: npm run update-organization-info -- 500 | ||
- run: npm run build:workspaces | ||
- name: Cypress run | ||
uses: cypress-io/[email protected] | ||
with: | ||
wait-on: ${{ env.MONCOMPTEPRO_HOST }}/users/start-sign-in | ||
wait-on: ${{ env.HOST }}/users/start-sign-in | ||
build: npm run build:assets | ||
start: npx dotenvx run -f cypress/e2e/${{ matrix.e2e_test }}/env.conf --overload -- npm start | ||
install: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
INSERT INTO users | ||
(id, email, email_verified, email_verified_at, encrypted_password, created_at, updated_at, given_name, family_name, phone_number, job, force_2fa) | ||
VALUES | ||
(1, '[email protected]', true, CURRENT_TIMESTAMP, '$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Lion', 'El''Jonson', 'I', 'Primarque', false); | ||
(1, '[email protected]', true, CURRENT_TIMESTAMP, '$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Lion', 'El''Jonson', 'I', 'Primarque', false), | ||
(2, '[email protected]', true, CURRENT_TIMESTAMP, '$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Raphapha', 'Dubibi', '0123456789', 'Sbire', false); | ||
|
||
INSERT INTO organizations | ||
(id, siret, created_at, updated_at) | ||
|
@@ -11,4 +12,5 @@ VALUES | |
INSERT INTO users_organizations | ||
(user_id, organization_id, is_external, verification_type, has_been_greeted) | ||
VALUES | ||
(1, 1, false, 'verified_email_domain', true); | ||
(1, 1, false, 'verified_email_domain', true), | ||
(2, 1, false, 'verified_email_domain', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ describe("add 2fa authentication", () => { | |
.contains("Configurer un code à usage unique") | ||
.click(); | ||
|
||
cy.contains("Configurer une application d’authentification"); | ||
|
||
// Extract the code from the front to generate the TOTP key | ||
cy.get("#humanReadableTotpKey") | ||
.invoke("text") | ||
|
@@ -36,4 +38,21 @@ describe("add 2fa authentication", () => { | |
}, | ||
); | ||
}); | ||
|
||
it("should see an help link on third failed attempt", function () { | ||
cy.visit("/connection-and-account"); | ||
|
||
cy.login("[email protected]"); | ||
|
||
cy.get('[href="/authenticator-app-configuration"]') | ||
.contains("Configurer un code à usage unique") | ||
.click(); | ||
|
||
cy.get("[name=totpToken]").type("123456"); | ||
cy.get( | ||
'[action="/authenticator-app-configuration"] [type="submit"]', | ||
).click(); | ||
|
||
cy.contains("Code invalide."); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ describe("sign-in with email verification renewal", () => { | |
|
||
cy.login("[email protected]"); | ||
|
||
cy.contains("Vérifier votre email"); | ||
cy.contains("Confirmer votre adresse"); | ||
|
||
cy.contains( | ||
"Information : pour garantir la sécurité de votre compte, nous avons besoin d’authentifier votre navigateur.", | ||
|
@@ -36,25 +36,17 @@ describe("sign-in with email verification renewal", () => { | |
|
||
cy.login("[email protected]"); | ||
|
||
cy.get('a[href="/users/verify-email-help"]') | ||
.contains( | ||
"J'ai attendu quelques secondes et je ne reçois pas de code de vérification", | ||
) | ||
.click(); | ||
|
||
cy.contains("Vous ne recevez pas le code de vérification"); | ||
|
||
cy.get('[action="/users/send-email-verification"] [type="submit"]') | ||
.contains("Cliquez ici pour recevoir un nouveau code") | ||
cy.get('[action="/users/send-email-verification"]') | ||
.contains("Recevoir un nouvel email") | ||
.should("be.disabled"); | ||
|
||
// Wait for countdown to last | ||
cy.wait(10 * 1000); | ||
|
||
cy.maildevDeleteAllMessages(); | ||
|
||
cy.get('[action="/users/send-email-verification"] [type="submit"]') | ||
.contains("Cliquez ici pour recevoir un nouveau code") | ||
cy.get('[action="/users/send-email-verification"]') | ||
.contains("Recevoir un nouvel email") | ||
.click(); | ||
|
||
cy.contains( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,12 @@ VALUES | |
'Jean', 'Jean', '0123456789', 'Sbire', | ||
'kuOSXGk68H2B3pYnph0uyXAHrmpbWaWyX/iX49xVaUc=.VMPBZSO+eAng7mjS.cI2kRY9rwhXchcKiiaMZIg==', | ||
CURRENT_TIMESTAMP, true | ||
), | ||
(4, '[email protected]', true, CURRENT_TIMESTAMP, | ||
'$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, | ||
'Jean', 'Jean', '0123456789', 'Sbire', | ||
'kuOSXGk68H2B3pYnph0uyXAHrmpbWaWyX/iX49xVaUc=.VMPBZSO+eAng7mjS.cI2kRY9rwhXchcKiiaMZIg==', | ||
CURRENT_TIMESTAMP, true | ||
); | ||
|
||
INSERT INTO organizations | ||
|
@@ -30,7 +36,9 @@ INSERT INTO users_organizations | |
(user_id, organization_id, is_external, verification_type, has_been_greeted) | ||
VALUES | ||
(1, 1, false, 'domain', true), | ||
(2, 1, false, 'domain', true); | ||
(2, 1, false, 'domain', true), | ||
(3, 1, false, 'domain', true), | ||
(4, 1, false, 'domain', true); | ||
|
||
INSERT INTO oidc_clients | ||
(client_name, client_id, client_secret, redirect_uris, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,17 +71,28 @@ describe("sign-in with TOTP on untrusted browser", () => { | |
cy.contains('"amr": [\n "pwd",\n "totp",\n "mfa"\n ],'); | ||
}); | ||
|
||
it("should trigger totp rate limiting", function () { | ||
it("should display error message", function () { | ||
cy.visit("/users/start-sign-in"); | ||
|
||
cy.login("[email protected]"); | ||
|
||
cy.get("[name=totpToken]").type("123456"); | ||
cy.get( | ||
'[action="/users/2fa-sign-in-with-authenticator-app"] [type="submit"]', | ||
).click(); | ||
cy.contains("Code invalide."); | ||
}); | ||
|
||
it("should trigger totp rate limiting", function () { | ||
cy.visit("/users/start-sign-in"); | ||
|
||
cy.login("[email protected]"); | ||
|
||
for (let i = 0; i < 5; i++) { | ||
cy.get("[name=totpToken]").type("123456"); | ||
cy.get( | ||
'[action="/users/2fa-sign-in-with-authenticator-app"] [type="submit"]', | ||
).click(); | ||
cy.contains("le code que vous avez utilisé est invalide."); | ||
} | ||
|
||
cy.get("[name=totpToken]").type("123456"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,9 @@ describe("Signup into new entreprise unipersonnelle", () => { | |
cy.get('[action="/users/sign-up"] [type="submit"]').click(); | ||
|
||
// Check that the website is waiting for the user to verify their email | ||
cy.get("#verify-email > p").contains("[email protected]"); | ||
cy.get("#verify-email > div > p").contains( | ||
"[email protected]", | ||
); | ||
|
||
cy.maildevGetMessageBySubject("Vérification de votre adresse email") | ||
.then((email) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
services: | ||
db: | ||
image: postgres:15.8 | ||
image: postgres:15.10 | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.