80394[FEATURE] Introduce class to generate/validate HMAC hashes
Commit message
Review
-
Code review CR +2 Done
- Oliver Hader +2
- Oliver Klee +1
- Andreas Kienast +1
-
Verified V +2 Done
- Oliver Hader +2
- Oliver Klee +1
- Andreas Kienast +1
- core-ci +1 CI
Issues 1
Files 6
- Build/phpstan/phpstan-baseline.neon+5 −0
- typo3/sysext/core/Classes/Crypto/HashService.phpnew+84 −0
- typo3/sysext/core/Classes/Exception/Crypto/EmptyAdditionalSecretException.php2new+25 −0
- typo3/sysext/core/Classes/Exception/Crypto/InvalidHashStringException.php2new+25 −0
- typo3/sysext/core/Documentation/Changelog/13.0/Feature-102761-IntroduceClassToGeneratevalidateHMACHashes.rstnew+29 −0
- typo3/sysext/core/Tests/Unit/Crypto/HashServiceTest.phpnew+155 −0
Review log 3142
Show 1117 earlier messages
-
Torben Hansen uploaded patch set 1 08/04/23, 14:25
-
core-ci voted on patch set 1 V +1 08/04/23, 14:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45073
-
Torben Hansen updated the commit message in patch set 2
V +109/26/23, 17:29 -
core-ci voted on patch set 2 V +1 09/26/23, 17:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47198
-
Torben Hansen rebased onto patch set 3
V +111/01/23, 18:16 -
core-ci voted on patch set 3 V +1 11/01/23, 18:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48449
-
Torben Hansen rebased onto patch set 4
V +101/04/24, 06:09 -
core-ci voted on patch set 4 V +1 01/04/24, 06:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51094
-
Torben Hansen uploaded patch set 5
V +101/05/24, 14:41 -
core-ci voted on patch set 5 V +1 01/05/24, 14:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51138
-
Simon Schaufelberger commented on patch set 5 01/05/24, 19:19
-
Torben Hansen uploaded patch set 6
V +101/06/24, 09:09 -
Torben Hansen commented on patch set 5 01/06/24, 09:09
Hash.php:38ReplyDone -
core-ci voted on patch set 6 V +1 01/06/24, 09:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51149
-
Oliver Klee commented on patch set 6 V +1 01/06/24, 09:29
Looks generally very good! I've added some remark get this changes polished before it goes in.Hash.php:32Let's help the developers via PHPStan here: ```php @param non-empty string $additionalSecret ```Hash.php:45```php @param non-empty string $additionalSecret ```Hash.php:53```php @param non-empty string $additionalSecret ```Hash.php:63```php @param non-empty string $string @param non-empty string $additionalSecret ```EmptyAdditionalSecretException.php:25Should we make it final?InvalidHashStringException.php:25Should we make it final?HashTest.php:42The assertNotEmpty is redundant with the more specific check in the next line. I suggest removing the assertNotEmpty check.HashTest.php:54In general, please let's use the type-safe `assertSame` wherever possible instead (for all `assertEquals` calls in this file). -
Torben Hansen uploaded patch set 7
V +101/06/24, 17:25 -
Torben Hansen commented on patch set 6 01/06/24, 17:26
Hash.php:32ReplyDoneHash.php:45ReplyDoneHash.php:53ReplyDoneHash.php:63ReplyDoneEmptyAdditionalSecretException.php:25ReplyAcknowledgedInvalidHashStringException.php:25ReplyAcknowledgedHashTest.php:42ReplyDoneHashTest.php:54ReplyDone
-
core-ci voted on patch set 7 V -1 01/06/24, 17:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51169
-
Torben Hansen commented on patch set 7 01/06/24, 17:36
@typo3-coding@oliverklee.de Should we add the new phpstan failures due to the `non-empty-string` attribute to the phpstan baseline? -
Oliver Klee commented on patch set 7 01/06/24, 18:04
Reply
Yes, please. (At least for the warning in production code.) For the warning in the test, we usually add a comment like this: ```php // @phpstan-ignore-next-line We are explicitly testing a contract violation here. ``` -
Oliver Klee commented on patch set 7 01/06/24, 18:20
Reply
For the production code warning, it might also make sense to add another `non-empty-string` annotation (cannot check right now). -
Oliver Klee commented on patch set 7 CR -1 01/06/24, 20:32
Reply
On it. -
Oliver Klee uploaded patch set 8
CR -1V -101/06/24, 20:35 -
Oliver Klee commented on patch set 7 CR -1 01/06/24, 20:35
Reply
Done -
Oliver Klee voted on patch set 8 CR +1 V +1 01/06/24, 20:36
-
core-ci voted on patch set 8 V +1 01/06/24, 20:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51170
-
Andreas Kienast commented on patch set 8 01/17/24, 08:36
Hash.php:37Would it make sense to use `__METHOD__` instead to make clear by reading it's a reference to this class method?Hash.php:59It feels strange to have the `$hmac` attribute between `$string` and `$additionalSecret`. I'd rather place it at the start or at the end of the parameter list. -
Torben Hansen uploaded patch set 9
CR +1V +101/18/24, 06:44 -
Torben Hansen commented on patch set 9 01/18/24, 06:44
Hash.php:37ReplyDoneHash.php:59ReplyDone -
core-ci voted on patch set 9 V +1 01/18/24, 06:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51721
-
Oliver Klee voted on patch set 9 CR +1 V +1 01/18/24, 08:46
-
Benjamin Franzke commented on patch set 9 CR -1 01/18/24, 09:19
Sorry to interrupt, but please make `TYPO3\CMS\Core\Crypto\Hash` a service in order to be able to use dependency injection (will be needed for configuration retrieval at some point). That means: no `static` method calls please. -
Torben Hansen uploaded patch set 10
CR +1V +101/18/24, 18:54 -
core-ci voted on patch set 10 V -1 01/18/24, 18:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51781
-
Torben Hansen uploaded patch set 11
V -101/18/24, 19:58 -
Torben Hansen commented on patch set 10 01/18/24, 19:58
Reply
Refactored the class to a service. -
core-ci voted on patch set 11 V +1 01/18/24, 20:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51782
-
Oliver Klee voted on patch set 11 CR +1 V +1 01/18/24, 22:07
-
Andreas Kienast voted on patch set 11 CR +1 V +1 01/19/24, 07:43
-
Oliver Hader voted on patch set 11 CR +1 V +1 01/23/24, 17:17
-
Oliver Hader voted on patch set 11 CR +2 V +2 01/23/24, 17:18
-
Oliver Hader merged patch set 12 01/23/24, 17:18
Hash.php:38