service-bus-symfony-bundle icon indicating copy to clipboard operation
service-bus-symfony-bundle copied to clipboard

Guard support

Open UFOMelkor opened this issue 7 years ago • 1 comments
trafficstars

The service-bus has two plugins to support authorization, the RouteGuard and the FinalizeGuard. Both rely on a simple interface AuthorizationService.

Any thoughts about …

  • … adding a AuthorizationService adapter for Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface
  • … allowing to enable each guard for each message-bus per configuration
  • … adding an (optional) event listener to convert Prooph\ServiceBus\Plugin\Guard\UnauthorizedException into Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException if it is not caught in the controller.

UFOMelkor avatar Jan 29 '18 07:01 UFOMelkor

@UFOMelkor

  • Adding an implementation of AuthorizationService in the bundle is a good idea, but I would do it for 1.1 release, not targeting upcoming 1.0 release, as this would only delay the final release (and it's not a strict requirement).

  • about enabling guards per bus: the guards are plugins, so it should already be possible to add them simply

  • convert Prooph\ServiceBus\Plugin\Guard\UnauthorizedException into Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - same as above, I would target this for 1.1 release.

prolic avatar Jan 29 '18 07:01 prolic