1 | <?php |
||
29 | class RevokeTokenHandler implements EmitterAwareInterface |
||
|
|||
30 | { |
||
31 | use EmitterAwareTrait, CryptTrait, RequestValidatorTrait; |
||
32 | |||
33 | /** |
||
34 | * @var ClientRepositoryInterface |
||
35 | */ |
||
36 | protected $clientRepository; |
||
37 | |||
38 | /** |
||
39 | * @var AccessTokenRepositoryInterface |
||
40 | */ |
||
41 | private $accessTokenRepository; |
||
42 | |||
43 | /** |
||
44 | * @var RefreshTokenRepositoryInterface |
||
45 | */ |
||
46 | private $refreshTokenRepository; |
||
47 | |||
48 | /** |
||
49 | * @var bool |
||
50 | */ |
||
51 | private $canRevokeAccessTokens; |
||
52 | |||
53 | /** |
||
54 | * @var CryptKey |
||
55 | */ |
||
56 | protected $publicKey; |
||
57 | |||
58 | /** |
||
59 | * New handler instance. |
||
60 | * |
||
61 | * @param RefreshTokenRepositoryInterface $refreshTokenRepository |
||
62 | * @param CryptKey|string $publicKey |
||
63 | * @param bool $canRevokeAccessTokens |
||
64 | */ |
||
65 | 12 | public function __construct( |
|
80 | |||
81 | /** |
||
82 | * @return ClientRepositoryInterface |
||
83 | */ |
||
84 | 12 | public function getClientRepository() |
|
88 | |||
89 | /** |
||
90 | * @param ClientRepositoryInterface $clientRepository |
||
91 | */ |
||
92 | 12 | public function setClientRepository(ClientRepositoryInterface $clientRepository) |
|
96 | |||
97 | /** |
||
98 | * @param AccessTokenRepositoryInterface $accessTokenRepository |
||
99 | */ |
||
100 | 12 | public function setAccessTokenRepository(AccessTokenRepositoryInterface $accessTokenRepository) |
|
104 | |||
105 | /** |
||
106 | * @param RefreshTokenRepositoryInterface $refreshTokenRepository |
||
107 | */ |
||
108 | 12 | public function setRefreshTokenRepository(RefreshTokenRepositoryInterface $refreshTokenRepository) |
|
112 | |||
113 | /** |
||
114 | * Set the public key |
||
115 | * |
||
116 | * @param CryptKey $key |
||
117 | */ |
||
118 | public function setPublicKey(CryptKey $key) |
||
122 | |||
123 | /** |
||
124 | * Return the grant identifier that can be used in matching up requests. |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | 12 | public function getIdentifier() { |
|
131 | |||
132 | /** |
||
133 | * Return an revoke token response. |
||
134 | * https://tools.ietf.org/html/rfc7009 |
||
135 | * |
||
136 | * @param ServerRequestInterface $request |
||
137 | * @param ResponseTypeInterface $response |
||
138 | * |
||
139 | * @throws OAuthServerException |
||
140 | * |
||
141 | * @return ResponseTypeInterface |
||
142 | */ |
||
143 | 12 | public function respondToRevokeTokenRequest(ServerRequestInterface $request, ResponseTypeInterface $response) |
|
192 | |||
193 | /** |
||
194 | * @param string $tokenParam |
||
195 | * @param string $clientId |
||
196 | * |
||
197 | * @return null|Token |
||
198 | */ |
||
199 | 6 | protected function readAsAccessToken($tokenParam, $clientId) { |
|
218 | |||
219 | /** |
||
220 | * @param string $tokenParam |
||
221 | * @param string $clientId |
||
222 | * |
||
223 | * @return null|array |
||
224 | */ |
||
225 | 8 | protected function readAsRefreshToken($tokenParam, $clientId) { |
|
240 | } |
||
241 |