1 | <?php |
||
18 | class Introspector |
||
19 | { |
||
20 | /** |
||
21 | * @var AccessTokenRepositoryInterface |
||
22 | */ |
||
23 | private $accessTokenRepository; |
||
24 | |||
25 | /** |
||
26 | * @var CryptKey |
||
27 | */ |
||
28 | private $privateKey; |
||
29 | |||
30 | /** |
||
31 | * @var Parser |
||
32 | */ |
||
33 | private $parser; |
||
34 | |||
35 | /** |
||
36 | * New Introspector instance. |
||
37 | * |
||
38 | * @param AccessTokenRepositoryInterface $accessTokenRepository |
||
39 | * @param CryptKey $privateKey |
||
40 | * @param Parser $parser |
||
41 | */ |
||
42 | 5 | public function __construct( |
|
52 | |||
53 | /** |
||
54 | * Return an introspection response. |
||
55 | * |
||
56 | * @param ServerRequestInterface $request |
||
57 | * |
||
58 | * @return IntrospectionResponse |
||
59 | */ |
||
60 | 5 | public function respondToIntrospectionRequest(ServerRequestInterface $request) |
|
77 | |||
78 | /** |
||
79 | * Validate the JWT token. |
||
80 | * |
||
81 | * @param Token $token |
||
82 | * |
||
83 | * @throws OAuthServerException |
||
84 | */ |
||
85 | 4 | private function verifyToken(Token $token) |
|
94 | |||
95 | /** |
||
96 | * Ensure access token hasn't expired |
||
97 | * |
||
98 | * @param Token $token |
||
99 | * |
||
100 | * @throws OAuthServerException |
||
101 | */ |
||
102 | 3 | private function checkIfTokenIsExpired(Token $token) |
|
110 | |||
111 | /** |
||
112 | * Check if the given access token is revoked. |
||
113 | * |
||
114 | * @param Token $token |
||
115 | * |
||
116 | * @throws OAuthServerException |
||
117 | */ |
||
118 | 2 | private function checkIfTokenIsRevoked(Token $token) |
|
124 | |||
125 | /** |
||
126 | * Create active introspection response. |
||
127 | * |
||
128 | * @param Token $token |
||
129 | * |
||
130 | * @return IntrospectionResponse |
||
131 | */ |
||
132 | 1 | private function createActiveResponse(Token $token) |
|
151 | |||
152 | /** |
||
153 | * Create inactive introspection response |
||
154 | * |
||
155 | * @return IntrospectionResponse |
||
156 | */ |
||
157 | 4 | private function createInactiveResponse() |
|
169 | } |
||
170 |