1 | <?php |
||
9 | class Blacklist |
||
10 | { |
||
11 | /** |
||
12 | * @var \Framgia\Jwt\Contracts\Storage |
||
13 | */ |
||
14 | protected $storage; |
||
15 | |||
16 | /** |
||
17 | * The grace period when a token is blacklisted. In seconds. |
||
18 | * |
||
19 | * @var int |
||
20 | */ |
||
21 | protected $gracePeriod = 0; |
||
22 | |||
23 | /** |
||
24 | * Number of minutes from issue date in which a JWT can be refreshed. |
||
25 | * |
||
26 | * @var int |
||
27 | */ |
||
28 | protected $refreshTTL = 20160; |
||
29 | |||
30 | /** |
||
31 | * The unique key held within the blacklist. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $key = 'jti'; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * @param \Framgia\Jwt\Contracts\Storage $storage |
||
40 | */ |
||
41 | public function __construct(Storage $storage) |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Add the token (jti claim) to the blacklist. |
||
49 | * |
||
50 | * @param \Lcobucci\JWT\Token $token |
||
51 | * |
||
52 | * @return bool |
||
53 | */ |
||
54 | public function add(Token $token) |
||
69 | |||
70 | /** |
||
71 | * Get the number of minutes until the token expiry. |
||
72 | * |
||
73 | * @param \Lcobucci\JWT\Token $token |
||
74 | * |
||
75 | * @return int |
||
76 | */ |
||
77 | protected function getMinutesUntilExpired(Token $token) |
||
86 | |||
87 | /** |
||
88 | * Add the token (jti claim) to the blacklist indefinitely. |
||
89 | * |
||
90 | * @param \Lcobucci\JWT\Token $token |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function addForever(Token $token) |
||
99 | |||
100 | /** |
||
101 | * Determine whether the token has been blacklisted. |
||
102 | * |
||
103 | * @param \Lcobucci\JWT\Token $token |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | public function has(Token $token) |
||
119 | |||
120 | /** |
||
121 | * Remove the token (jti claim) from the blacklist. |
||
122 | * |
||
123 | * @param \Lcobucci\JWT\Token $token |
||
124 | * |
||
125 | * @return bool |
||
126 | */ |
||
127 | public function remove(Token $token) |
||
131 | |||
132 | /** |
||
133 | * Remove all tokens from the blacklist. |
||
134 | * |
||
135 | * @return bool |
||
136 | */ |
||
137 | public function clear() |
||
142 | |||
143 | /** |
||
144 | * Get the timestamp when the blacklist comes into effect |
||
145 | * This defaults to immediate (0 seconds). |
||
146 | * |
||
147 | * @return int |
||
148 | */ |
||
149 | protected function getGraceTimestamp() |
||
153 | |||
154 | /** |
||
155 | * Set the grace period. |
||
156 | * |
||
157 | * @param int $gracePeriod |
||
158 | * |
||
159 | * @return $this |
||
160 | */ |
||
161 | public function setGracePeriod($gracePeriod) |
||
166 | |||
167 | /** |
||
168 | * Get the unique key held within the blacklist. |
||
169 | * |
||
170 | * @param \Lcobucci\JWT\Token $token |
||
171 | * |
||
172 | * @return mixed |
||
173 | */ |
||
174 | public function getKey(Token $token) |
||
178 | |||
179 | /** |
||
180 | * Set the unique key held within the blacklist. |
||
181 | * |
||
182 | * @param string $key |
||
183 | * |
||
184 | * @return $this |
||
185 | */ |
||
186 | public function setKey($key) |
||
191 | |||
192 | /** |
||
193 | * Set the refresh time limit. |
||
194 | * |
||
195 | * @param int $ttl |
||
196 | * |
||
197 | * @return $this |
||
198 | */ |
||
199 | public function setRefreshTTL($ttl) |
||
204 | } |
||
205 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.