1 | <?php |
||
16 | class Introspector |
||
17 | { |
||
18 | /** |
||
19 | * @var AccessTokenRepositoryInterface |
||
20 | */ |
||
21 | private $accessTokenRepository; |
||
22 | |||
23 | /** |
||
24 | * @var CryptKey |
||
25 | */ |
||
26 | private $privateKey; |
||
27 | |||
28 | /** |
||
29 | * @var Parser |
||
30 | */ |
||
31 | private $parser; |
||
32 | |||
33 | /** |
||
34 | * New Introspector instance. |
||
35 | * |
||
36 | * @param AccessTokenRepositoryInterface $accessTokenRepository |
||
37 | * @param CryptKey $privateKey |
||
38 | * @param Parser $parser |
||
39 | */ |
||
40 | 5 | public function __construct( |
|
49 | |||
50 | /** |
||
51 | * Return an introspection response. |
||
52 | * |
||
53 | * @param ServerRequestInterface $request |
||
54 | * |
||
55 | * @return IntrospectionResponse |
||
56 | */ |
||
57 | 5 | public function respondToIntrospectionRequest(ServerRequestInterface $request) |
|
73 | |||
74 | /** |
||
75 | * Validate the JWT token. |
||
76 | * |
||
77 | * @param Token $token |
||
78 | * |
||
79 | * @throws OAuthServerException |
||
80 | */ |
||
81 | 4 | private function verifyToken(Token $token) |
|
90 | |||
91 | /** |
||
92 | * Ensure access token hasn't expired |
||
93 | * |
||
94 | * @param Token $token |
||
95 | * |
||
96 | * @throws OAuthServerException |
||
97 | */ |
||
98 | 3 | private function checkIfTokenIsExpired(Token $token) |
|
106 | |||
107 | /** |
||
108 | * Check if the given access token is revoked. |
||
109 | * |
||
110 | * @param Token $token |
||
111 | * |
||
112 | * @throws OAuthServerException |
||
113 | */ |
||
114 | 2 | private function checkIfTokenIsRevoked(Token $token) |
|
120 | |||
121 | /** |
||
122 | * Create active introspection response. |
||
123 | * |
||
124 | * @param Token $token |
||
125 | * |
||
126 | * @return IntrospectionResponse |
||
127 | */ |
||
128 | 1 | private function createActiveResponse(Token $token) |
|
147 | |||
148 | /** |
||
149 | * Create inactive introspection response |
||
150 | * |
||
151 | * @return IntrospectionResponse |
||
152 | */ |
||
153 | 4 | private function createInactiveResponse() |
|
165 | } |
||
166 |