62035[BUGFIX] Respect "access" option on backend routes
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 7
- typo3/sysext/backend/Classes/Http/RouteDispatcher.php3+9 −15
- typo3/sysext/backend/Classes/Middleware/BackendRouteMatcher.php2new+42 −0
- typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php2+3 −35
- typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php+1 −0
- typo3/sysext/backend/Configuration/RequestMiddlewares.php+9 −0
- typo3/sysext/backend/Tests/Unit/Http/RouteDispatcherTest.php+16 −36
- typo3/sysext/backend/Tests/Unit/Middleware/BackendRouteMatcherTest.php2new+68 −0
Review log 1115
-
Markus Poerschke uploaded patch set 1 10/21/19, 12:12
-
TYPO3com voted on patch set 1 V -1 10/21/19, 12:23 Completed build in 11m 11s on Mon, 21 Oct, 12:23 PM Test Summary: 4 of 48377 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37410
-
Markus Poerschke uploaded patch set 2 10/21/19, 16:01
-
TYPO3com voted on patch set 2 V -1 10/21/19, 16:10 Completed build in 09m 25s on Mon, 21 Oct, 04:10 PM Test Summary: 4 of 48381 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37433
-
Markus Poerschke uploaded patch set 3 11/03/19, 09:00
-
TYPO3com voted on patch set 3 V -1 11/03/19, 09:10 Completed build in 09m 44s on Sun, 3 Nov, 09:10 AM Test Summary: 48078 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37938
-
Oli Bartsch commented on patch set 3 11/03/19, 10:52
BackendRouteMatcher.php:1declare strict typesBackendUserAuthenticator.php:68This is wrong, as there is only one parameter registered for `setBackendUserAspect` AFAICS.BackendRouteMatcherTest.php:2Declare strict types -
Markus Poerschke uploaded patch set 4 11/04/19, 10:41
-
Markus Poerschke commented on patch set 4 11/04/19, 10:42
This change is ready for review. -
Markus Poerschke commented on patch set 4 11/04/19, 10:44
> Patch Set 3: > > (4 comments) I changed the source code according to the comments,RouteDispatcher.php:83ReplyDoneBackendRouteMatcher.php:1ReplyDoneBackendUserAuthenticator.php:68ReplyDoneBackendRouteMatcherTest.php:2ReplyDone -
TYPO3com voted on patch set 4 V +1 11/04/19, 11:00 Completed build in 11m 54s on Mon, 4 Nov, 11:00 AM Test Summary: 48085 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37967
-
Simon Gilli commented on patch set 4 11/04/19, 12:09
Unresolved
add 9.5 to this line: master, 9.5RouteDispatcher.php:70Unresolvedparameters should be declared here -
Benni Mack commented on patch set 4 11/04/19, 12:52
Currently "public" means that there is no "token" argument added nor validated. The access toe any backend- related resource is still placed in a middleware. For TYPO3 v9 I'd keep it as is, and suggest you replace the middleware via an extension to make it extensible. For TYPO3 v10, I'd actually move the Routing itself into a middleware, and add a proper registration for backend routes (also on a per-HTTP-verb basis, also adding placeholders). What do you think? -
Markus Poerschke commented on patch set 4 CR -1 11/04/19, 15:45
> Patch Set 4: > > Currently "public" means that there is no "token" argument added nor validated. The access toe any backend- related resource is still placed in a middleware. > > For TYPO3 v9 I'd keep it as is, and suggest you replace the middleware via an extension to make it extensible. > > For TYPO3 v10, I'd actually move the Routing itself into a middleware, and add a proper registration for backend routes (also on a per-HTTP-verb basis, also adding placeholders). What do you think? Indeed I could overcome my problem with an addional Middleware that looks like this (thanks for the idea Benni!): class PublicBackendControllerMiddleware implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { if ($request->getAttribute('routePath') === '/ajax/login/my-public-backend-route') { return $this->myPublicBackendController->someAction($request); } return $handler->handle($request); } } Personally both patches are not needed for my purpose anymore. The advantage of the Middleware-Solution is, that it will work in both versions. Therefore I agree with Bennis remarks: 1. Do not touch v9.5 2. Wait for Benni’s "proper registration for backend routes" 3. Hence I will close, ticket and the reviews. -
Markus Poerschke abandoned the change 11/04/19, 15:48
The change is not needed since an easy workaround in the third-party extension can solve the problem. The backend routes registration will be reworked in v10, therefore this change is obsolete.
RouteDispatcher.php:83