78008[WIP][FEATURE] Provide PSR-7 request globally in user authentication
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 1
Review log 910
-
Torben Hansen uploaded patch set 1 03/02/23, 18:44
-
core-ci voted on patch set 1 V +1 03/02/23, 18:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38323
-
Alexander Schnitzler commented on patch set 1 03/03/23, 09:17
-
Torben Hansen commented on patch set 1 03/03/23, 09:27
AbstractUserAuthentication.php:1310ReplyThe current problem is, that `$GLOBALS['TYPO3_REQUEST']` (which should not be used by extension authors anyway) is not initialized at this point of the authentication process. So 3rd party authentication services have no possiblity to access the PSR-7 request in any way and need to retrieve all data manually. If e.g. site config is required by an authentication service, it must manually be fetched in the 3rd party authentication service (really a pain, if you do not have a request object, since `SiteMatcher` also requires a PSR-7 request). Having the PSR-7 request available through the getter, allows 3rd party authentication services to access the PSR-7 request using `$this->pObj->getRequest()` -
Christian Kuhn commented on patch set 1 CR -2 03/03/23, 09:52
AbstractUserAuthentication.php:1310Replyimho not a good idea. this allows fetching request from a global state de facto singleton instance throughout the system, especially when public. also, since user auth is a middleware thing, the request will probably change further, so this object is potentially an old instance. -
Christian Kuhn voted on patch set 1 CR -1 03/03/23, 09:53
-
Benni Mack commented on patch set 1 CR -1 03/03/23, 09:53
As I've been working in this area quite a lot, I recommend just adding it to authInfo array or something the like, so it ain't too "public" for everyone (think of $GLOBALS[BE_USER]->getRequest() - I wouldn't want that :)). -
Christian Kuhn commented on patch set 1 03/03/23, 09:56
AbstractUserAuthentication.php:1310Reply Unresolvedthe issue with the auth services has to me modeled differently somehow .. probobly by actively handing around the request, not by allowing it to be get'ed from "pObj" Since the auth service api sucks so hard, it may need adaptions before to deal with this properly. -
Torben Hansen commented on patch set 1 03/03/23, 10:12
Reply
Ah, did`nt have the `$GLOBALS[BE_USER]->getRequest()` in mind - yes, thats not good :-) -
Torben Hansen abandoned the change 03/03/23, 10:12
No good idea
AbstractUserAuthentication.php:1310