73832[FEATURE] Introduce TCA type "password"
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Benni Mack +1
-
Verified V +2 Done
- Oli Bartsch +2
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 23
- Build/Sources/TypeScript/backend/form-engine-validation.ts+1 −2
- Build/Sources/TypeScript/backend/form-engine.ts+0 −13
- typo3/sysext/backend/Classes/Form/Element/InputTextElement.php+0 −5
- typo3/sysext/backend/Classes/Form/Element/PasswordElement.php21new+205 −0
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessPlaceholders.php2+2 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php+1 −0
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaRecordTitle.php2+14 −0
- typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php+1 −0
- typo3/sysext/backend/Classes/Form/NodeFactory.php+1 −0
- typo3/sysext/backend/Classes/Utility/BackendUtility.php2+6 −8
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine-validation.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine.js+1 −1
- typo3/sysext/core/Classes/DataHandling/DataHandler.php22+52 −17
- typo3/sysext/core/Classes/DataHandling/TableColumnType.php+1 −0
- typo3/sysext/core/Classes/Migrations/TcaMigration.php2+57 −0
- typo3/sysext/core/Configuration/TCA/be_users.php+2 −5
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-97104-NewTCATypePassword.rst8new+122 −0
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php5+4 −6
- typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php+120 −0
- typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapFactoryTest.php+1 −0
Review log 4160
Show 2435 earlier messages
-
Torben Hansen uploaded patch set 1 03/06/22, 13:01
-
Torben Hansen marked it work in progress 03/06/22, 13:03
-
core-ci voted on patch set 1 V +1 03/06/22, 13:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24639
-
Benni Mack commented on patch set 1 03/07/22, 18:15
-
Torben Hansen commented on patch set 1 03/10/22, 10:32
DataHandler.php:1828I see some problems if we make this too configurable. At least, for the tables fe_users and be_users, this must be fixed to either "FE" or "BE", since configured password hashing from TYPO3_CONF_VARS must be used and this is also hardcoded in several places in TYPO3 core (e.g. $saltFactory->get($currentPasswordHashed, 'BE') in ext:setup or in changePasswordAction() of ext:felogin). If we allow a PHP classname here, should we also allow to configure password hashing options like PasswordHashFactory does? -
Benni Mack commented on patch set 1 03/11/22, 07:49
DataHandler.php:1828ReplyGood points, let us keep it as is for the time being! -
Torben Hansen rebased onto patch set 2 03/13/22, 12:42
-
core-ci voted on patch set 2 V +1 03/13/22, 12:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24857
-
Torben Hansen uploaded patch set 3 03/15/22, 18:57
-
core-ci voted on patch set 3 V +1 03/15/22, 19:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24913
-
Torben Hansen uploaded patch set 4 03/16/22, 08:03
-
Torben Hansen marked it ready for review 03/16/22, 08:03
-
Torben Hansen uploaded patch set 5 03/16/22, 08:05
-
core-ci voted on patch set 4 V -1 03/16/22, 08:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24933
-
core-ci voted on patch set 5 V -1 03/16/22, 08:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24934
-
Torben Hansen uploaded patch set 6 03/16/22, 10:34
-
core-ci voted on patch set 6 V +1 03/16/22, 10:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24941
-
Torben Hansen commented on patch set 6 03/16/22, 11:07
DataHandler.php:1828ReplyAs discussed earlier, we leave this as it is. -
Oli Bartsch commented on patch set 6 03/16/22, 18:04
Hi Torben, thanks for your patch. I did a first read and added some comments accordingly.PasswordElement.php:48Do those wizards make any sense at all? They will just display "*********".PasswordElement.php:83We might filter the list here since only "null" should be considered, see this patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/73977 for reference.PasswordElement.php:87Shouldn't we use `<input type="password">` instead?PasswordElement.php:101This should always be done for this TCA type. Additionally, this should be removed from InputTextElement now.PasswordElement.php:141I think "is_in" shouldn't be supportedPasswordElement.php:154This could then be customized (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password#allowing_autocomplete) once we are using "<input type=password".PasswordElement.php:205Those variables are superfluous, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/73894.TcaColumnsProcessPlaceholders.php:24Do we need to adjust TcaInputPlaceholders as well?TcaRecordTitle.php:411This is now the same as `getRecordTitleForStandardTextField()`. However I would suggest we also replace the value with `*******` here? While it does not make much sense to use the password as record title at all, we should not expose the raw database value (no matter if hashed or not). See the usage in `getProcessedValue()` as example.BackendUtility.php:1681I don't see the benefit of the "random number". Should we just use a static number? IMO would make the UI more clear.DataHandler.php:86Do we need to adjust DataMapProcessor as well?DataHandler.php:1525The list is sorted alphabeticallyDataHandler.php:1807Let's just add parameters, we actually use.DataHandler.php:1823This should be done before the required checkDataHandler.php:1826Could be simplified to: "!(tcaFieldConf['hashed'] ?? false)"DataHandler.php:1827Shouldn't we check more explicit here (table<=>fieldname)?Feature-97104-NewTCATypePassword.rst:29"max" is missing hereFeature-97104-NewTCATypePassword.rst:41"max" is missing here.DataHandlerTest.php:223Is there a reason to remove this test? AFAICS the behaviour should still apply. -
Torben Hansen uploaded patch set 7 03/17/22, 19:14
-
Torben Hansen commented on patch set 7 03/17/22, 19:14
PasswordElement.php:48ReplyYes, right. I'll remove them.PasswordElement.php:83ReplyDonePasswordElement.php:87ReplySee discussion here: https://typo3.slack.com/archives/C03AM9R17/p1645363953753829 I personally would go for input=password with autocomplete=off - this gives us the possibility to remove this line.PasswordElement.php:101ReplyDonePasswordElement.php:141ReplyDonePasswordElement.php:154ReplySee input type=password comment. Should we go for input=password?PasswordElement.php:205ReplyDoneTcaColumnsProcessPlaceholders.php:24ReplyYes, I think we shouldTcaRecordTitle.php:411ReplyDoneBackendUtility.php:1681ReplyAgree, changed it to ********DataHandler.php:86ReplyIf you mean getPrefixLanguageTitleFieldNames(), I think prefixLangTitle should not apply to password fields.DataHandler.php:1525ReplyDoneDataHandler.php:1807ReplyDoneDataHandler.php:1823ReplyDoneDataHandler.php:1826ReplyThen the condition would also match, if tcaFieldConf['hashed'] is not set, since it would result in "!false -> true"DataHandler.php:1827ReplyUnsure about this. fe_users and be_users are TYPO3 internal tables and we should not allow to save plain text passwords (also for custom password fields) to those tables.Feature-97104-NewTCATypePassword.rst:29ReplyDoneFeature-97104-NewTCATypePassword.rst:41ReplyDoneDataHandlerTest.php:223ReplyTest was removed, because I also removed the "saltedPassword" eval in DataHandler. Since the change can be considered breaking, I re-added the "saltedPassword" eval to dataHandler and also re-added the test. However, I think we should deprecate the "saltedPassword" eval in DataHandler, since we now also have the logic to TCA type=password. -
core-ci voted on patch set 7 V -1 03/17/22, 19:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24967
-
Torben Hansen uploaded patch set 8 03/18/22, 06:40
-
core-ci voted on patch set 8 V +1 03/18/22, 06:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24985
-
Torben Hansen uploaded patch set 9 03/19/22, 17:31
-
core-ci voted on patch set 9 V -1 03/19/22, 17:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24999
-
Torben Hansen uploaded patch set 10 03/20/22, 07:00
-
core-ci voted on patch set 10 V -1 03/20/22, 07:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25003
-
Torben Hansen uploaded patch set 11 03/20/22, 10:46
-
core-ci voted on patch set 11 V +1 03/20/22, 10:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25005
-
Torben Hansen commented on patch set 11 03/20/22, 11:02
PasswordElement.php:87ReplyDonePasswordElement.php:154ReplyDone -
Oli Bartsch commented on patch set 11 03/21/22, 10:30
PasswordElement.php:63password is not allowed and is added below anywaysDataHandler.php:1826ReplySure, you are right, default has to be TRUE: "!(tcaFieldConf['hashed'] ?? true)"DataHandler.php:1827ReplyOke, should we then document this?DataHandler.php:2811This is removed/migrated in the TcaMigration and will therefore never match.TcaMigration.php:818Has to be "saltedPassword".DataHandlerTest.php:223ReplyIt's fine, "saltedPassword" is migrated in the TcaMigration and therefore no breaking change. Actually the current state does not work since the DataHandler part will never be called due to the TcaMigration. What I meant, the functionality, this test case checked, should still apply. Therefore we should change the test to call `checkValueForPassword()`. -
Oliver Hader commented on patch set 11 03/21/22, 14:12
PasswordElement.php:84I know I'm late to this party... however, instead of continuing generating HTML in PHP, we might consider handling new elements (new TCA types) as custom-element instead. For instance we did that in v11 with the table wizard element, see * https://github.com/TYPO3/typo3/blob/929dcbf07cbfb906fd2f7e20b79f50aedd875762/typo3/sysext/backend/Classes/Form/Element/TextTableElement.php#L250 * https://github.com/TYPO3/typo3/blob/7a41f9052f89215220625c6d5e7a5ed21009667b/Build/Sources/TypeScript/backend/element/table-wizard-element.ts What do you think? -
Benni Mack commented on patch set 11 03/21/22, 15:46
PasswordElement.php:84Replyyeah, I think this makes sense to do this. but I think we should do this in a separate step (I guess there is more to it related to FormEngine JS) -
Torben Hansen uploaded patch set 12 03/24/22, 09:22
-
Torben Hansen commented on patch set 12 03/24/22, 09:24
PasswordElement.php:63ReplyDoneDataHandler.php:1826ReplyDoneDataHandler.php:1827ReplyDoneDataHandler.php:2811ReplyDoneTcaMigration.php:818ReplyDoneDataHandlerTest.php:223ReplyI'm struggling a bit with how to implement this. `checkValueForPassword()` is declared protected, so we can not call this directly in the test. Should I try to mock dataHandler or should I try to call `checkValue_SW`? -
core-ci voted on patch set 12 V -1 03/24/22, 09:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25094
-
Oli Bartsch uploaded patch set 13 03/25/22, 17:35
-
Oli Bartsch commented on patch set 13 03/25/22, 17:35
DataHandlerTest.php:223ReplyDone -
core-ci voted on patch set 13 V +1 03/25/22, 17:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25149
-
Benni Mack commented on patch set 13 03/25/22, 18:19
PasswordElement.php:84ReplyDone -
Benni Mack commented on patch set 13 03/25/22, 18:20
fe_users.php:42I think we can remove "max" herefe_users.php:44should we have this as "default"? -
Torben Hansen uploaded patch set 14 03/25/22, 18:58
-
Torben Hansen commented on patch set 14 03/25/22, 18:59
fe_users.php:42ReplyDone. Also changed this in be_usersfe_users.php:44ReplyYes, now we have `autocomplete=off` as default and `autocomplete=new-fieldname` if the autocomplete config is set to `true` in TCA. -
Benni Mack commented on patch set 14 03/25/22, 19:00
Feature-97104-NewTCATypePassword.rst:39I question this option ;)Feature-97104-NewTCATypePassword.rst:63should be "saltedPassword" -
Benni Mack commented on patch set 15 03/25/22, 19:02
Published edit on patch set 14. -
core-ci voted on patch set 14 V +1 03/25/22, 19:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25150
-
core-ci voted on patch set 15 V -1 03/25/22, 19:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25151
-
core-ci voted on patch set 15 V +1 03/25/22, 20:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25151
-
Oli Bartsch uploaded patch set 16 03/25/22, 23:08
-
Oli Bartsch commented on patch set 16 03/25/22, 23:09
Feature-97104-NewTCATypePassword.rst:39ReplyDoneFeature-97104-NewTCATypePassword.rst:63ReplyDone -
core-ci voted on patch set 16 V +1 03/25/22, 23:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25166
-
Oli Bartsch voted on patch set 16 V +1 CR +1 03/25/22, 23:19
-
Oli Bartsch uploaded patch set 17 03/25/22, 23:58
-
Benni Mack voted on patch set 17 V +1 CR +1 03/26/22, 00:02
-
core-ci voted on patch set 17 V -1 03/26/22, 00:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25169
-
core-ci voted on patch set 17 V +1 03/26/22, 00:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25169
-
Oli Bartsch commented on patch set 17 V -1 CR +2 03/26/22, 00:18
Will prepare styleguide adjustments. -
Oli Bartsch commented on patch set 17 V +2 03/26/22, 12:04
Reply
PR created at https://github.com/TYPO3/styleguide/pull/310. -
Oli Bartsch merged patch set 18 03/26/22, 12:04
DataHandler.php:1828