1 | <?php |
||
26 | class AnnotationDriver |
||
27 | { |
||
28 | /** |
||
29 | * @var Reader |
||
30 | */ |
||
31 | private $reader; |
||
32 | |||
33 | /** |
||
34 | * @var TokenStorageInterface |
||
35 | */ |
||
36 | private $tokenStorage; |
||
37 | |||
38 | /** |
||
39 | * @var Checker[] |
||
40 | */ |
||
41 | private $checkers = []; |
||
42 | |||
43 | /** |
||
44 | * @var OAuth2MessageFactoryManager |
||
45 | */ |
||
46 | private $oauth2ResponseFactoryManager; |
||
47 | |||
48 | /** |
||
49 | * AnnotationDriver constructor. |
||
50 | * |
||
51 | * @param Reader $reader |
||
52 | * @param TokenStorageInterface $tokenStorage |
||
53 | * @param OAuth2MessageFactoryManager $oauth2ResponseFactoryManager |
||
54 | */ |
||
55 | public function __construct(Reader $reader, TokenStorageInterface $tokenStorage, OAuth2MessageFactoryManager $oauth2ResponseFactoryManager) |
||
61 | |||
62 | /** |
||
63 | * @param Checker $checker |
||
64 | * |
||
65 | * @return AnnotationDriver |
||
66 | */ |
||
67 | public function add(Checker $checker): self |
||
73 | |||
74 | /** |
||
75 | * @return Checker[] |
||
76 | */ |
||
77 | public function all(): array |
||
81 | |||
82 | public function onKernelController(FilterControllerEvent $event) |
||
99 | |||
100 | /** |
||
101 | * @param FilterControllerEvent $event |
||
102 | * |
||
103 | * @param OAuth2 $configuration |
||
104 | */ |
||
105 | private function processOAuth2Annotation(FilterControllerEvent $event, OAuth2 $configuration): void |
||
123 | |||
124 | /** |
||
125 | * @param FilterControllerEvent $event |
||
126 | * @param string $message |
||
127 | * @param OAuth2 $configuration |
||
128 | */ |
||
129 | private function createAuthenticationException(FilterControllerEvent $event, string $message, OAuth2 $configuration) |
||
143 | |||
144 | /** |
||
145 | * @param FilterControllerEvent $event |
||
146 | * @param string $message |
||
147 | * @param OAuth2 $configuration |
||
148 | * @param \Exception $previous |
||
149 | */ |
||
150 | private function createAccessDeniedException(FilterControllerEvent $event, string $message, OAuth2 $configuration, \Exception $previous) |
||
164 | |||
165 | /** |
||
166 | * @param FilterControllerEvent $event |
||
167 | * @param ResponseInterface $psr7Response |
||
168 | */ |
||
169 | private function updateFilterControllerEvent(FilterControllerEvent $event, ResponseInterface $psr7Response) |
||
178 | } |
||
179 |