Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat update politique #3080

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
fileignoreconfig:
- filename: _scripts/db/dumps/domifa_test.postgres.restore-data-only.sql
checksum: 8c3fbddbda155e81d1ce861dfa05c391c60199d539272d4013b71ae0100648ea
checksum: 144c6e1bb9936d9cc8feda8736c7ca2d69df0eaec4032edfe1dc9655135d531b
- filename: _scripts/db/dumps/domifa_test.postgres.truncate-restore-data-only.sql
checksum: 88414b9693efe32632ed9eed749e3cdc4ec5e66030160941e8d9643dfc61ad7b
checksum: 4f58baf962c6c05d8580ec3d234da282ae82275631d7ed7b73bdffaf6be9cd06
- filename: packages/backend/src/_common/decorators/IsValidPasswordDecorator.ts
checksum: f0d4b3cd2e6e2d9b1e0271c34d64adacf87a5f1e7a505402a20869962543608d
- filename: packages/backend/src/_migrations/1699910877010-auto-migration.ts
checksum: bd05dd6b68f7fe2ca36ab1180a0449878cf78f4e048d2e5979b3dbe5fba1db53
- filename: packages/backend/src/_migrations/_init-db/1603812391580-pr-env-create-database.ts
checksum: 4933dc2edd58b0d9ced8906548fec306389d66a0b415b99cd29dc09fdfe76c3b
- filename: packages/backend/src/_portail-admin/portail-admin-login/portail-admin-login.controller.spec.ts
checksum: 3bd78f8919cbe14a45484825d6ce816bc7e2a0456fc53b9beeb1fedb6bdb061a
- filename: packages/backend/src/_tests/_core/constants/TESTS_USERS_STRUCTURE.mock.ts
checksum: 7fd396491726fce9ed96ac175c3acdb9ae93ecac0d66e7c6fc5554c5deeceb6f
- filename: packages/backend/src/auth/structures-auth.controller.spec.ts
checksum: 5cc345a4fee5809b8cbb892e660cfc90a12c674b90919767037e9235a9f222ee
- filename: packages/backend/src/database/services/user-usager/user-usager-security/userUsagerSecurityPasswordUpdater.service.ts
checksum: 725e69e0017746a36f12e18f55c084ed3b733d2b0b5adf88c1978cc940fe8439
- filename: packages/backend/src/interactions/services/InteractionsDeletor.service.spec.ts
checksum: b66659fea19859e55afaf0ed47519f0804857e486b2ecc6b01d5ae96f1a86a0b
- filename: packages/backend/src/users/dto/reset-password.dto.ts
checksum: 459ec0c5e439bca5375d3a06f4868f8078ca2ad1895fdc5c84bc81cc6bc394fc
- filename: packages/backend/src/users/users.public.controller.spec.ts
checksum: c92d7fdda68498beff9b1680e5cc4b4ee6f0d658bb5a25efd6dd228fd8ce061e
- filename: packages/frontend/src/app/modules/general/components/login/login.component.ts
checksum: 478ac6427b28b5473166ea12bc5ffe275d6dfb1bf3c190c1d852012907f4d317
- filename: packages/frontend/src/app/modules/users/components/user-structure-password-form/user-structure-password-form.component.html
checksum: 6b7878776dbcf983b920e6fdb090a52f5f79f3e4e36187c1460aff17c0cfba83
- filename: packages/frontend/src/app/modules/users/components/user-structure-password-form/user-structure-password-form.component.spec.ts
checksum: 7749036582dd467fd5c71aba534aec66fecabc3185b7fd7ee75705204877b654
- filename: packages/frontend/src/assets/files/news.json
checksum: eef674a077a8c6b56e087ae5d664b10ba956b435f6e29cc241f90ba55f8c1f7a
- filename: packages/portail-usagers/src/app/modules/general/components/_static/cgu/cgu.component.html
checksum: 584da8c9b8ebc95d1d996d0201e0e57cf31e05c6704104e7adacba67a7eb4dd7
- filename: packages/portail-usagers/src/app/modules/usager-auth/services/usager-auth.service.ts
Expand Down
Binary file modified _scripts/db/dumps/domifa_test.postgres.custom.gz
Binary file not shown.
20 changes: 10 additions & 10 deletions _scripts/db/dumps/domifa_test.postgres.restore-data-only.sql
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,16 @@ c9192746-debf-48de-bd13-6fb5b2ee866b 2022-03-08 23:22:50.29536+01 2022-03-08 23:
--

COPY public.user_structure (uuid, "createdAt", "updatedAt", version, email, fonction, id, "lastLogin", nom, password, prenom, role, "structureId", mails, "passwordLastUpdate", verified, "acceptTerms") FROM stdin;
663b9baa-2880-406c-a93a-32fe65528037 2020-11-17 14:18:47.658346+01 2020-11-17 14:18:47.658346+01 1 [email protected] \N 2 \N Juste $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Isabelle simple 1 {"guide": false, "import": false} \N t \N
59c846d8-0592-4790-a5e2-1daae9b8776e 2020-11-14 14:18:27.658736+01 2020-11-14 14:18:27.658736+01 1 [email protected] \N 6 2021-06-28 15:27:26.095+02 Dupuis $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Facteur 1 facteur 1 {"guide": true, "import": true} \N t \N
4e049e3d-bb65-48e5-8661-b1ccdc9db985 2021-09-21 00:03:26.186917+02 2021-09-21 00:03:26.186917+02 2 [email protected] Simple testeur 8 \N Jacquet $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Aimé simple 3 {"guide": false, "import": false} \N t \N
44f1cfe8-eae9-49d5-aedb-76dda856c413 2021-02-01 17:12:30.90825+01 2021-02-01 17:13:04.64034+01 2 [email protected] Testeur admin 7 \N Test $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Import admin 4 {"guide": false, "import": false} \N t \N
d81c5566-94f9-4ee4-ab57-a604a654f79b 2020-11-17 14:32:22.193933+01 2020-11-17 14:39:14.015103+01 17 [email protected] \N 5 2020-11-17 14:39:13.796+01 Roseline $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Parmentier admin 3 {"guide": false, "import": false} 2020-11-17 14:39:14.013+01 t \N
f6b20e00-77e7-46e6-b48d-8cca69161042 2020-11-17 14:32:22.193+01 2021-12-06 16:26:01.366576+01 4 [email protected] Responsable structure 10 2021-12-06 16:26:01.365+01 Etchebest $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Philippe responsable 3 {"guide": false, "import": false} \N t \N
d19ece1f-d32b-498c-9427-eb12b1251163 2020-11-17 14:26:29.482634+01 2020-11-17 14:26:29.490297+01 2 [email protected] \N 4 \N Test $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Facteur facteur 3 {"guide": false, "import": false} \N t \N
b0140303-79e3-436c-9c41-1eaefeeaed6e 2020-11-17 14:23:20.248011+01 2022-03-09 00:20:21.36073+01 9 [email protected] \N 3 2022-03-09 00:20:21.356+01 Smith $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Peter responsable 1 {"guide": false, "import": false} \N t \N
343b62db-6c85-4896-b994-18c8c89b710f 2022-03-17 17:25:53.798318+01 2022-03-23 22:08:39.505536+01 36 [email protected] \N 11 2022-03-23 22:08:39.502+01 Pali $2a$10$/Jn6nqdRG.f.OVDphuCbCeCDCy34sKBucgkLmqL2lSwzjSuexFgX. Mauricette admin 5 {"guide": false, "import": false} 2022-03-17 17:25:53.78+01 t \N
da01f451-9c4f-4f6c-98bb-c635277e33e7 2020-11-17 14:18:47.658346+01 2023-09-05 23:50:23.454502+02 390 [email protected] \N 1 2023-09-05 23:50:23.453+02 Roméro $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Patrick admin 1 {"guide": false, "import": false} \N t 2023-02-14 18:33:51.261+01
663b9baa-2880-406c-a93a-32fe65528037 2020-11-17 14:18:47.658346+01 2020-11-17 14:18:47.658346+01 1 [email protected] \N 2 \N Juste $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Isabelle simple 1 {"guide": false, "import": false} \N t \N
59c846d8-0592-4790-a5e2-1daae9b8776e 2020-11-14 14:18:27.658736+01 2020-11-14 14:18:27.658736+01 1 [email protected] \N 6 2021-06-28 15:27:26.095+02 Dupuis $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Facteur 1 facteur 1 {"guide": true, "import": true} \N t \N
4e049e3d-bb65-48e5-8661-b1ccdc9db985 2021-09-21 00:03:26.186917+02 2021-09-21 00:03:26.186917+02 2 [email protected] Simple testeur 8 \N Jacquet $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Aimé simple 3 {"guide": false, "import": false} \N t \N
44f1cfe8-eae9-49d5-aedb-76dda856c413 2021-02-01 17:12:30.90825+01 2021-02-01 17:13:04.64034+01 2 [email protected] Testeur admin 7 \N Test $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Import admin 4 {"guide": false, "import": false} \N t \N
d81c5566-94f9-4ee4-ab57-a604a654f79b 2020-11-17 14:32:22.193933+01 2020-11-17 14:39:14.015103+01 17 [email protected] \N 5 2020-11-17 14:39:13.796+01 Roseline $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Parmentier admin 3 {"guide": false, "import": false} 2020-11-17 14:39:14.013+01 t \N
f6b20e00-77e7-46e6-b48d-8cca69161042 2020-11-17 14:32:22.193+01 2021-12-06 16:26:01.366576+01 4 [email protected] Responsable structure 10 2021-12-06 16:26:01.365+01 Etchebest $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Philippe responsable 3 {"guide": false, "import": false} \N t \N
d19ece1f-d32b-498c-9427-eb12b1251163 2020-11-17 14:26:29.482634+01 2020-11-17 14:26:29.490297+01 2 [email protected] \N 4 \N Test $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Facteur facteur 3 {"guide": false, "import": false} \N t \N
b0140303-79e3-436c-9c41-1eaefeeaed6e 2020-11-17 14:23:20.248011+01 2022-03-09 00:20:21.36073+01 9 [email protected] \N 3 2022-03-09 00:20:21.356+01 Smith $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Peter responsable 1 {"guide": false, "import": false} \N t \N
343b62db-6c85-4896-b994-18c8c89b710f 2022-03-17 17:25:53.798318+01 2022-03-23 22:08:39.505536+01 36 [email protected] \N 11 2022-03-23 22:08:39.502+01 Pali $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Mauricette admin 5 {"guide": false, "import": false} 2022-03-17 17:25:53.78+01 t \N
da01f451-9c4f-4f6c-98bb-c635277e33e7 2020-11-17 14:18:47.658346+01 2023-09-05 23:50:23.454502+02 390 [email protected] \N 1 2023-09-05 23:50:23.453+02 Roméro $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Patrick admin 1 {"guide": false, "import": false} \N t 2023-02-14 18:33:51.261+01
\.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,16 @@ c9192746-debf-48de-bd13-6fb5b2ee866b 2022-03-08 23:22:50.29536+01 2022-03-08 23:
--

COPY public.user_structure (uuid, "createdAt", "updatedAt", version, email, fonction, id, "lastLogin", nom, password, prenom, role, "structureId", mails, "passwordLastUpdate", verified, "acceptTerms") FROM stdin;
663b9baa-2880-406c-a93a-32fe65528037 2020-11-17 14:18:47.658346+01 2020-11-17 14:18:47.658346+01 1 [email protected] \N 2 \N Juste $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Isabelle simple 1 {"guide": false, "import": false} \N t \N
59c846d8-0592-4790-a5e2-1daae9b8776e 2020-11-14 14:18:27.658736+01 2020-11-14 14:18:27.658736+01 1 [email protected] \N 6 2021-06-28 15:27:26.095+02 Dupuis $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Facteur 1 facteur 1 {"guide": true, "import": true} \N t \N
4e049e3d-bb65-48e5-8661-b1ccdc9db985 2021-09-21 00:03:26.186917+02 2021-09-21 00:03:26.186917+02 2 [email protected] Simple testeur 8 \N Jacquet $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Aimé simple 3 {"guide": false, "import": false} \N t \N
44f1cfe8-eae9-49d5-aedb-76dda856c413 2021-02-01 17:12:30.90825+01 2021-02-01 17:13:04.64034+01 2 [email protected] Testeur admin 7 \N Test $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Import admin 4 {"guide": false, "import": false} \N t \N
d81c5566-94f9-4ee4-ab57-a604a654f79b 2020-11-17 14:32:22.193933+01 2020-11-17 14:39:14.015103+01 17 [email protected] \N 5 2020-11-17 14:39:13.796+01 Roseline $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Parmentier admin 3 {"guide": false, "import": false} 2020-11-17 14:39:14.013+01 t \N
f6b20e00-77e7-46e6-b48d-8cca69161042 2020-11-17 14:32:22.193+01 2021-12-06 16:26:01.366576+01 4 [email protected] Responsable structure 10 2021-12-06 16:26:01.365+01 Etchebest $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Philippe responsable 3 {"guide": false, "import": false} \N t \N
d19ece1f-d32b-498c-9427-eb12b1251163 2020-11-17 14:26:29.482634+01 2020-11-17 14:26:29.490297+01 2 [email protected] \N 4 \N Test $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Facteur facteur 3 {"guide": false, "import": false} \N t \N
b0140303-79e3-436c-9c41-1eaefeeaed6e 2020-11-17 14:23:20.248011+01 2022-03-09 00:20:21.36073+01 9 [email protected] \N 3 2022-03-09 00:20:21.356+01 Smith $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Peter responsable 1 {"guide": false, "import": false} \N t \N
343b62db-6c85-4896-b994-18c8c89b710f 2022-03-17 17:25:53.798318+01 2022-03-23 22:08:39.505536+01 36 [email protected] \N 11 2022-03-23 22:08:39.502+01 Pali $2a$10$/Jn6nqdRG.f.OVDphuCbCeCDCy34sKBucgkLmqL2lSwzjSuexFgX. Mauricette admin 5 {"guide": false, "import": false} 2022-03-17 17:25:53.78+01 t \N
da01f451-9c4f-4f6c-98bb-c635277e33e7 2020-11-17 14:18:47.658346+01 2023-09-05 23:50:23.454502+02 390 [email protected] \N 1 2023-09-05 23:50:23.453+02 Roméro $2a$10$3yXcVfWYOWsI/KzAwZ0BrOay1Dp/ZOF5RjhLL0QA2Pt7gQVg2U86u Patrick admin 1 {"guide": false, "import": false} \N t 2023-02-14 18:33:51.261+01
663b9baa-2880-406c-a93a-32fe65528037 2020-11-17 14:18:47.658346+01 2020-11-17 14:18:47.658346+01 1 [email protected] \N 2 \N Juste $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Isabelle simple 1 {"guide": false, "import": false} \N t \N
59c846d8-0592-4790-a5e2-1daae9b8776e 2020-11-14 14:18:27.658736+01 2020-11-14 14:18:27.658736+01 1 [email protected] \N 6 2021-06-28 15:27:26.095+02 Dupuis $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Facteur 1 facteur 1 {"guide": true, "import": true} \N t \N
4e049e3d-bb65-48e5-8661-b1ccdc9db985 2021-09-21 00:03:26.186917+02 2021-09-21 00:03:26.186917+02 2 [email protected] Simple testeur 8 \N Jacquet $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Aimé simple 3 {"guide": false, "import": false} \N t \N
44f1cfe8-eae9-49d5-aedb-76dda856c413 2021-02-01 17:12:30.90825+01 2021-02-01 17:13:04.64034+01 2 [email protected] Testeur admin 7 \N Test $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Import admin 4 {"guide": false, "import": false} \N t \N
d81c5566-94f9-4ee4-ab57-a604a654f79b 2020-11-17 14:32:22.193933+01 2020-11-17 14:39:14.015103+01 17 [email protected] \N 5 2020-11-17 14:39:13.796+01 Roseline $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Parmentier admin 3 {"guide": false, "import": false} 2020-11-17 14:39:14.013+01 t \N
f6b20e00-77e7-46e6-b48d-8cca69161042 2020-11-17 14:32:22.193+01 2021-12-06 16:26:01.366576+01 4 [email protected] Responsable structure 10 2021-12-06 16:26:01.365+01 Etchebest $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Philippe responsable 3 {"guide": false, "import": false} \N t \N
d19ece1f-d32b-498c-9427-eb12b1251163 2020-11-17 14:26:29.482634+01 2020-11-17 14:26:29.490297+01 2 [email protected] \N 4 \N Test $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Facteur facteur 3 {"guide": false, "import": false} \N t \N
b0140303-79e3-436c-9c41-1eaefeeaed6e 2020-11-17 14:23:20.248011+01 2022-03-09 00:20:21.36073+01 9 [email protected] \N 3 2022-03-09 00:20:21.356+01 Smith $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Peter responsable 1 {"guide": false, "import": false} \N t \N
343b62db-6c85-4896-b994-18c8c89b710f 2022-03-17 17:25:53.798318+01 2022-03-23 22:08:39.505536+01 36 [email protected] \N 11 2022-03-23 22:08:39.502+01 Pali $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Mauricette admin 5 {"guide": false, "import": false} 2022-03-17 17:25:53.78+01 t \N
da01f451-9c4f-4f6c-98bb-c635277e33e7 2020-11-17 14:18:47.658346+01 2023-09-05 23:50:23.454502+02 390 [email protected] \N 1 2023-09-05 23:50:23.453+02 Roméro $2a$10$GQ5/A/bv3NU/lHeaEP35EuOSHQkapPtU1RHy/G1nHuNwujOkovosa Patrick admin 1 {"guide": false, "import": false} \N t 2023-02-14 18:33:51.261+01
\.


Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@domifa/backend",
"private": true,
"version": "2.142.0",
"version": "2.145.0",
"description": "",
"author": "",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {

export function IsValidPassword(
property: string,
deprecatedRegex: boolean = false,
validationOptions?: ValidationOptions
) {
// eslint-disable-next-line @typescript-eslint/ban-types
Expand All @@ -20,16 +21,16 @@ export function IsValidPassword(
validate(value: any, args: ValidationArguments) {
const [relatedPropertyName] = args.constraints;
const relatedValue = (args.object as any)[relatedPropertyName];
return checkPasswordStrength(value, relatedValue);
return checkPasswordStrength(value, relatedValue, deprecatedRegex);
},
},
});
};
}

export function checkPasswordStrength(
value?: any,
relatedValue?: any
relatedValue?: any,
deprecatedRegex: boolean = false
): boolean {
if (!value && !relatedValue) {
return false;
Expand All @@ -41,5 +42,14 @@ export function checkPasswordStrength(
if (value.length > 150 || value.length < 12) {
return false;
}
return new RegExp(/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)[^]{12,}$/).test(value);

if (deprecatedRegex) {
return new RegExp(/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)[^]{12,}$/).test(
value
);
}

return new RegExp(
/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)(?=.*?[@\[\]^_!"#$%&'()*+,\-./:;{}<>=|~?])[^]{12,}$/
).test(value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { checkPasswordStrength } from "../IsValidPasswordDecorator";
describe("checkPasswordStrength", () => {
it("Passwords OK", () => {
const testPasswords = [
"Azerty0123456",
"LsKVYkXBxDR3",
"Azerty0123456!",
"LsKVYkXBxDR3!",
"!!!!!!V3K5nWvq84Fj",
" §'/(//(nvew3gKvzgKn",
"x$rQAzhmaW(2Fzuk",
"Allez les bleus2022",
"!x$rQAzhmaW(2Fzuk",
"!Allez les bleus2022",
"cpXJydcMV7WjuVc7E2nDIpgHvt)LXhexqh#HvSVN8W6u&x8*LnmXVU&m@5uzfrD",
];
testPasswords.forEach((valueOk: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("Admins Login Controller", () => {
.post("/portail-admins/auth/login")
.send({
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
});
expect(response.status).toBe(HttpStatus.OK);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,63 @@ const ALL: TestUserStructure[] = [
id: 1,
structureId: 1,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "admin",
},
{
uuid: "663b9baa-2880-406c-a93a-32fe65528037",
id: 2,
structureId: 1,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "simple",
},
{
uuid: "b0140303-79e3-436c-9c41-1eaefeeaed6e",
id: 3,
structureId: 1,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "responsable",
},
{
uuid: "59c846d8-0592-4790-a5e2-1daae9b8776e",
id: 6,
structureId: 1,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "facteur",
},
{
uuid: "d81c5566-94f9-4ee4-ab57-a604a654f79b",
id: 5,
structureId: 3,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "admin",
},
{
uuid: "f6b20e00-77e7-46e6-b48d-8cca69161042",
id: 10,
structureId: 3,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "responsable",
},
{
uuid: "4e049e3d-bb65-48e5-8661-b1ccdc9db985",
id: 8,
structureId: 3,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "simple",
},
{
uuid: "d19ece1f-d32b-498c-9427-eb12b1251163",
id: 4,
structureId: 3,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "facteur",
},

Expand All @@ -72,15 +72,15 @@ const ALL: TestUserStructure[] = [
id: 7,
structureId: 4,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "admin",
},
{
uuid: "4e049e3d-bb65-48e5-8661-b1ccdc9db985",
id: 11,
structureId: 5,
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
role: "admin",
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("Structure Auth Controller", () => {
.post("/structures/auth/login")
.send({
email: "[email protected]",
password: "Azerty012345",
password: "Azerty012345!",
});
expect(response.status).toBe(HttpStatus.OK);
});
Expand Down
Loading
Loading