77424[FEATURE] Add password policy validation for TCA type=password
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Benni Mack +1
-
Verified V +2 Done
- Georg Ringer +2
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 10
- Build/Sources/TypeScript/backend/form-engine/element/password-element.ts4new+57 −0
- typo3/sysext/backend/Classes/Form/Element/PasswordElement.php4+63 −3
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine/element/password-element.jsnew+13 −0
- typo3/sysext/core/Classes/DataHandling/DataHandler.php13+58 −2
- typo3/sysext/core/Classes/PasswordPolicy/Validator/AbstractPasswordValidator.php+2 −1
- typo3/sysext/core/Configuration/TCA/be_users.php2+1 −0
- typo3/sysext/core/Documentation/Changelog/12.3/Feature-97389-AddPasswordPolicyValidationForTCATypepassword.rstnew+48 −0
- typo3/sysext/core/Resources/Private/Language/locallang_password_policy.xlf+3 −0
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php+2 −2
- typo3/sysext/frontend/Configuration/TCA/fe_users.php+1 −0
Review log 2839
Show 1014 earlier messages
-
Torben Hansen uploaded patch set 1 01/17/23, 16:40
-
core-ci voted on patch set 1 V +1 01/17/23, 16:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35982
-
Stefan Bürk updated the commit message in patch set 2
V +101/17/23, 20:56 -
Stefan Bürk updated the commit message in patch set 3 01/17/23, 20:57
-
Stefan Bürk commented on patch set 3 01/17/23, 21:11
-
core-ci voted on patch set 2 V +1 01/17/23, 21:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36029
-
core-ci voted on patch set 3 V +1 01/17/23, 21:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36030
-
Stefan Bürk voted on patch set 3 V +1 01/17/23, 21:21
-
Georg Ringer commented on patch set 3 01/17/23, 21:28
DataHandler.php:1849Replyif not configurable I would turn it around, be_users => always BE, rest is FE but configuration would be nicer -
Torben Hansen commented on patch set 3 01/18/23, 12:13
DataHandler.php:1849ReplyI agree, that a configuration option for the mode (which overrides the current `$mode` evaluation) would be nice in a dedicated change. If we change the current evaluation as Georg suggested, this would be a breaking change, if FE password hashing algorithm != BE password hashing algorithm, so I suggest to keep this as it is for now. -
Oli Bartsch commented on patch set 3 01/18/23, 16:13
password-element.ts:33Should we use this.querySelector() instead?password-element.ts:34This should ne a direct child of the "element", right?PasswordElement.php:32I would like to omit class properties in such classes. We should just pass the instance to renderPasswordPolicyRequirements() - if initialized at all.PasswordElement.php:220This check is duplicated.DataHandler.php:1857This operation might not be necessary, depending on the isValidPassword() check below.DataHandler.php:1868Shouldn't we use the already available functionality `printLogErrorMessages()`, which collects the errors and prints them as flash message?be_users.php:56Let's avoid introducing new dependencies to $GLOBALS, especially in TCA. We recently removed this in some other places, e.g. https://review.typo3.org/c/Packages/TYPO3.CMS/+/75916/17/typo3/sysext/core/Documentation/Changelog/12.0/Feature-98479-NewTCATypeFile.rst#82Feature-97389-AddPasswordPolicyValidationForTCATypepassword.rst:1Actually we always try to make the rst a bit less technical. Currently the RST completely duplicates the commit message. Could this please be improved? -
Torben Hansen uploaded patch set 4
V +101/21/23, 17:41 -
Torben Hansen commented on patch set 3 01/21/23, 17:41
password-element.ts:33ReplyDonepassword-element.ts:34ReplyAckPasswordElement.php:32ReplyDonePasswordElement.php:220ReplyAgree, the `$passwordPolicy` is typecasted in `GU::implodeAttributes()`.DataHandler.php:1857ReplyDone, moved the whole password hashing part below the password policy checkDataHandler.php:1868ReplyNo, `printLogErrorMessages()` collects error messages from `sys_log`. This does not make sense in case of password policies, since it would require to log all failed password policy validators to `sys_log`.be_users.php:56ReplyThe password policy for the field `password` in `be_users` and `fe_users` is actually a global setting, so I think this is a valid usage of `$GLOBALS` in TCA here. If we would not use `$GLOBALS` here, we have to hardcode the evaluation of the global configured password policy in both `DataHandler` and `PasswordElement`, if the field is `password` and the table is either `fe_users` or `be_users`. This seems not really good to me and would also produce duplicate code.Feature-97389-AddPasswordPolicyValidationForTCATypepassword.rst:1ReplyUpdated the RST to make the "Impact" section less technical. -
core-ci voted on patch set 4 V +1 01/21/23, 17:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36413
-
Benni Mack commented on patch set 4 01/23/23, 14:36
DataHandler.php:1864please no flashMessages here, anymore.use "->log()" and "->printLogErrorMessages()" instead. -
Torben Hansen uploaded patch set 5
V +101/26/23, 07:31 -
Torben Hansen commented on patch set 5 01/26/23, 07:33
DataHandler.php:1849ReplyConfiguration option for mode should be made in a follow up patch.DataHandler.php:1864ReplyDone -
core-ci voted on patch set 5 V -1 01/26/23, 07:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36638
-
Torben Hansen uploaded patch set 6
V -101/26/23, 07:48 -
core-ci voted on patch set 6 V +1 01/26/23, 07:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36639
-
Torben Hansen rebased onto patch set 7
V +102/07/23, 18:19 -
core-ci voted on patch set 7 V +1 02/07/23, 18:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37307
-
Benni Mack commented on patch set 8
V +102/08/23, 07:49Published edit on patch set 7. -
core-ci voted on patch set 8 V +1 02/08/23, 08:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37328
-
Georg Ringer commented on patch set 8 V +1 CR +1 02/08/23, 08:20
in a next step, persisting should be avoided if the password doesn't meet the criteria - is that possible to validate password with ajax endpoint? -
Benni Mack commented on patch set 8 02/08/23, 09:48
DataHandler.php:1881what is 95? -
Torben Hansen commented on patch set 8 02/08/23, 10:09
Reply
Yes, this will be part of https://forge.typo3.org/issues/97393DataHandler.php:1881ReplyA new `$details_nr`. I was actually unsure which number to use here and thought it would be good to have a unique number for those kind of log entries, so they can be filtered/excluded from queries if required. I'm also fine using either `0` or `-1`, if this is better. -
Torben Hansen rebased onto patch set 9
CR +1V +103/12/23, 17:17 -
core-ci voted on patch set 9 V +1 03/12/23, 17:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38833
-
Torben Hansen uploaded patch set 10
V +103/12/23, 17:49 -
Torben Hansen commented on patch set 10 03/12/23, 17:49
DataHandler.php:1881ReplyChanged this it `-1` -
core-ci voted on patch set 10 V +1 03/12/23, 18:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38839
-
Benni Mack voted on patch set 10 CR +1 03/14/23, 20:59
-
Georg Ringer voted on patch set 10 V +1 CR +1 03/15/23, 06:48
-
Markus Klein updated the commit message in patch set 11
CR +1V +103/16/23, 09:54 -
core-ci voted on patch set 11 V +1 03/16/23, 10:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39047
-
Benni Mack commented on patch set 11 V +1 CR +1 03/22/23, 16:53
In general this is OK, however we should adapt this feature after feature freeze to validate on-the-fly with JS so the user knows what he/she entered -
Georg Ringer voted on patch set 11 V +2 CR +2 03/23/23, 05:29
-
Georg Ringer merged patch set 12 03/23/23, 05:29
DataHandler.php:1849