69337[!!!][TASK] Send user session cookies as hash-signed JWT
Commit message
Review
-
Code review CR +2 Done
- Oliver Hader +2
- Kevin Appelt +1
- Stefan Bürk +1
- Christian Kuhn +1
-
Verified V +2 Done
- Oliver Hader +2
- Stefan Bürk +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 8
- typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php+2 −1
- typo3/sysext/core/Classes/Session/UserSession.php5+41 −0
- typo3/sysext/core/Classes/Session/UserSessionManager.php+14 −4
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-94243-SendUserSessionCookiesAsHash-signedJWT.rst3new+54 −0
- typo3/sysext/core/Tests/Unit/Session/UserSessionManagerTest.php4+13 −1
- typo3/sysext/core/Tests/Unit/Session/UserSessionTest.php+4 −0
- typo3/sysext/frontend/Tests/Unit/Authentication/FrontendUserAuthenticationTest.php+12 −1
- composer.lock+5 −5
Review log 6181
Show 4156 earlier messages
-
Oliver Hader uploaded patch set 1 05/31/21, 13:33
-
core-ci voted on patch set 1 V -1 05/31/21, 13:47 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12039
-
Oliver Hader commented on patch set 1 05/31/21, 14:05
Fails since testing framework simulates cookie and needs to be adjusted as well: https://github.com/TYPO3/testing-framework/blob/d74a027a186d62e6218b8e29328449d9b97e259f/Classes/Core/Functional/FunctionalTestCase.php#L425 -
Oliver Hader marked it work in progress 11/18/21, 10:48
-
Benni Mack wrote 11/29/21, 10:16
Change destination moved from master to main -
Benni Mack updated the commit message in patch set 2 11/29/21, 14:02
-
core-ci voted on patch set 2 V -1 11/29/21, 18:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20071
-
Oliver Hader rebased onto patch set 3 03/25/22, 13:53
-
Oliver Hader commented on patch set 3 03/25/22, 13:56
Testing framework is failing currently due to the missing session-id signature -
core-ci voted on patch set 3 V -1 03/25/22, 14:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25140
-
Oliver Hader uploaded patch set 4 05/06/22, 09:01
-
core-ci voted on patch set 4 V -1 05/06/22, 09:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26894
-
Oliver Hader uploaded patch set 5 05/06/22, 10:07
-
core-ci voted on patch set 5 V -1 05/06/22, 10:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26899
-
core-ci commented on patch set 5 05/06/22, 10:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26899
-
core-ci commented on patch set 5 05/06/22, 10:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26899
-
core-ci commented on patch set 5 05/06/22, 10:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26899
-
Oliver Hader uploaded patch set 6 05/06/22, 11:23
-
core-ci voted on patch set 6 V +1 05/06/22, 11:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26904
-
Mathias Brodala commented on patch set 6 05/06/22, 12:41
JwtTrait.php:27Should we throw an error instead? I could imagine that this silent fallback affects security. -
Oliver Hader commented on patch set 6 05/06/22, 12:57
JwtTrait.php:27ReplyThere's a check during the bootstrap, I guess that's enough... https://github.com/TYPO3/typo3/blob/14cbf0f76778a0253d347fd847d6cfc1d8e709f1/typo3/sysext/core/Classes/Core/Bootstrap.php#L470-L478 But it means, the fallback can be removed... -
Mathias Brodala commented on patch set 6 05/06/22, 12:58
JwtTrait.php:27ReplyBasically yes but PHPStan or similar may complain about this. ;-) -
Oliver Hader uploaded patch set 7 05/06/22, 12:59
-
core-ci voted on patch set 7 V -1 05/06/22, 13:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26913
-
Oliver Hader commented on patch set 7 05/06/22, 13:12
This change is ready for review. -
core-ci voted on patch set 7 V +1 05/06/22, 13:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26913
-
Stefan Bürk commented on patch set 7 05/07/22, 13:05
Would suggest to leave "[WIP]" here until TF is mergend and fork removed/tf update added.Would this not be a "breaking task backport" into LTS version ?composer.json:43Patch should be marked as "[WIP]" as long as the fork is used. Additionally patch can be only merged after corresponding TF change is properly merged into corresponding TF branches AND raised in core versions (main/11) - see comment in TF draft pull-request.composer.json:64Code makes this extension mandantory. So this *must* be added to `typo3/sysext/core/composer.json`. This however will introduce a new required dependency to a LTS version - was this on the screen and decided as valid to introduce ? -
Oliver Klee commented on patch set 7 05/07/22, 13:22
JwtTrait.php:27Just to be safe for incomplete installations, we should use ?? for the array access. -
Oliver Klee commented on patch set 7 05/07/22, 14:10
UserSession.php:285Do we expect cases where the cookie has no value (or an empty value), and we could improve performance to catch this early before trying to decode it? -
Mathias Brodala commented on patch set 7 05/09/22, 07:04
Reply
Or switch back to WIP on Gerrit. No need for the [WIP] workaround. -
Oliver Hader commented on patch set 7 05/09/22, 07:39
Reply
AckReply
Actually I don't know whether there are extensions that fiddle around with the cookie handling in AbstractUserAuthentication, but the possibility exists. I'd be fine with taking that into `main` only or use a feature flag for LTS branches.composer.json:43ReplyYes, thing this is, that not many people review patches that are "WIP" - however, I'd like to have that feedback and reviews.composer.json:64ReplySee my recent comment above (in commit message). There's no other possibility than introducing a new package dependency in order to make use of its features. What kind of problems would you expect for v11 LTS in this particular case?JwtTrait.php:27ReplyPlease see https://review.typo3.org/c/Packages/TYPO3.CMS/+/69337/7#message-855d26adef8dd266a03d855d17060c0fa8433967 - I just removed the `?? ''` a patch-set ago.UserSession.php:285ReplyGood one, empty cookie-values can be filtered out -
Oliver Hader marked it work in progress 05/09/22, 07:39
-
Oliver Klee commented on patch set 7 05/09/22, 09:22
JwtTrait.php:27ReplyAck -
Oliver Hader uploaded patch set 8 05/09/22, 12:07
-
Oliver Hader commented on patch set 8 05/09/22, 12:09
This change is ready for review.Reply
I'm giving up 11.5 for the time being, I just cannot oversee possible implications.composer.json:43ReplyDonecomposer.json:64ReplyUsed `^5.5 || ^6.0` nowUserSession.php:285ReplyDone -
core-ci voted on patch set 8 V +1 05/09/22, 12:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27024
-
Oliver Klee commented on patch set 8 05/09/22, 13:09
JwtTrait.php:23Please add a short explanation about what this trait does. And should it be @internal?UserSession.php:225If the return value is guaranteed to be non-empty, we can make this more specific to help static code analysis: @return non-empty-string -
Oliver Klee commented on patch set 8 CR -1 05/09/22, 15:26
composer.json:39I think we need to mark the changeset as WIP as long as this snippet is here to keep people from merging this prematurely.JwtTrait.php:31Please add a PHPDoc with a more specific annotation for $payload.UserSessionManagerTest.php:182Why do we need a logger Prophecy-stub here? Wouldn't the (real) NullLogger suffice? -
Oliver Hader commented on patch set 8 06/01/22, 13:36
composer.json:39ReplyChicken-egg problem... nobody looks into changes that did not pass CI-run or are marked WIP. But yeah it's obvious this has to be adjusted before actually merging it.JwtTrait.php:31Reply"more specific" in terms of "types"?UserSessionManagerTest.php:182ReplyBecause of `class UserSessionManager implements LoggerAwareInterface` -
Oliver Klee commented on patch set 8 06/01/22, 13:43
JwtTrait.php:31ReplyYes. (This will help both human readers as well as allow PHPStan to do more specific static analysis.) -
Oliver Klee commented on patch set 8 06/01/22, 13:44
composer.json:39ReplyAck -
Oliver Hader commented on patch set 8 06/01/22, 13:49
UserSessionManagerTest.php:182ReplyI misread the question - yes, `NullLogger` instance can be used directly here... the stub stems from an older version of this change that aimed to assert `debug` method would be invoked. -
Oliver Hader uploaded patch set 9 06/01/22, 14:01
-
Oliver Hader commented on patch set 9 06/01/22, 14:01
JwtTrait.php:31ReplyDoneUserSessionManagerTest.php:182ReplyDone -
core-ci voted on patch set 9 V -1 06/01/22, 14:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27623
-
Oliver Klee commented on patch set 9 09/25/22, 18:31
Is there any chance to get this into 12LTS?composer.json:58If this is main-only now, we use the latest ^6.3.0 directly. -
Oliver Hader commented on patch set 9 09/26/22, 08:34
Reply
https://review.typo3.org/c/Packages/TYPO3.CMS/+/74183 should be tackled first (and covers those JWT topics)... Cookie signing is also deadlocked by testing-framework... -
Georg Ringer commented on patch set 9 10/01/22, 20:02
Reply
merged now -
Oliver Hader uploaded patch set 10 10/03/22, 08:47
-
Markus Klein commented on patch set 10 CR +1 10/03/22, 08:55
Very lovely. Thank you! -
core-ci voted on patch set 10 V -1 10/03/22, 09:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31930
-
Oliver Hader uploaded patch set 11 10/03/22, 09:20
-
Oliver Hader commented on patch set 11 10/03/22, 09:32
composer.json:58ReplyIrrelevant for the latest state of this changeJwtTrait.php:23ReplyIrrelevant for this changeUserSession.php:225ReplyI did not manage to do this without having to create a cascade of changes, due to `should return non-empty-string but returns string` in the whole call-hierarchy. Skipped for this patch. -
core-ci voted on patch set 11 V -1 10/03/22, 09:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31931
-
Oliver Hader uploaded patch set 12 10/03/22, 09:50
-
Oliver Hader uploaded patch set 13 10/03/22, 09:56
-
core-ci voted on patch set 12 V -1 10/03/22, 10:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31933
-
core-ci voted on patch set 13 V +1 10/03/22, 10:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31934
-
Benni Mack voted on patch set 13 CR +1 10/03/22, 17:58
-
Georg Ringer voted on patch set 13 CR +1 10/03/22, 18:48
-
Stefan Bürk uploaded patch set 14 10/03/22, 18:53
-
Stefan Bürk voted on patch set 14 V +1 CR +1 10/03/22, 18:58
-
Christian Kuhn voted on patch set 14 V +1 CR +1 10/03/22, 19:00
-
Georg Ringer voted on patch set 14 CR +1 10/03/22, 19:00
-
core-ci voted on patch set 14 V +1 10/03/22, 19:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31954
-
Georg Ringer commented on patch set 14 CR -1 10/03/22, 19:02
Breaking-94243-SendUserSessionCookiesAsHash-signedJWT.rst:42I guess there is something missing -
Oliver Hader commented on patch set 15 10/03/22, 19:06
Published edit on patch set 14. -
Oliver Hader commented on patch set 15 10/03/22, 19:06
Breaking-94243-SendUserSessionCookiesAsHash-signedJWT.rst:42ReplyDone -
Christian Kuhn uploaded patch set 16 10/03/22, 19:07
-
Christian Kuhn commented on patch set 14 V +1 CR +1 10/03/22, 19:07
Breaking-94243-SendUserSessionCookiesAsHash-signedJWT.rst:42ReplyDone -
Christian Kuhn voted on patch set 16 V +1 CR +1 10/03/22, 19:07
-
Stefan Bürk voted on patch set 16 V +1 CR +1 10/03/22, 19:07
-
Christian Kuhn commented on patch set 16 10/03/22, 19:09
sorry oli, seems we pushed the same thing in the same minute. -
core-ci voted on patch set 16 V +1 10/03/22, 19:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31956
-
Kevin Appelt voted on patch set 16 CR +1 10/03/22, 19:17
-
core-ci voted on patch set 15 V +1 10/03/22, 19:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31955
-
Oliver Hader commented on patch set 16 CR +1 10/03/22, 19:21
Fine for me. Any other objections? -
Christian Kuhn commented on patch set 16 10/03/22, 19:22
Reply
go ahead. -
Oliver Hader voted on patch set 16 V +2 CR +2 10/03/22, 19:27
-
Oliver Hader merged patch set 17 10/03/22, 19:27
-
Oliver Hader commented on patch set 17 10/03/22, 19:28
Thanks folks ❤️