1 | <?php |
||
22 | abstract class AbstractLoader |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $token; |
||
28 | |||
29 | /** |
||
30 | * @var JWKSet |
||
31 | */ |
||
32 | protected $jwkset; |
||
33 | |||
34 | /** |
||
35 | * @var Checker\HeaderChecker[] |
||
36 | */ |
||
37 | protected $headerCheckers = []; |
||
38 | |||
39 | /** |
||
40 | * @var Checker\ClaimChecker[] |
||
41 | */ |
||
42 | protected $claimCheckers = []; |
||
43 | |||
44 | /** |
||
45 | * @var string[] |
||
46 | */ |
||
47 | protected $allowedAlgorithms = []; |
||
48 | |||
49 | /** |
||
50 | * @var Algorithm[] |
||
51 | */ |
||
52 | protected $algorithms = []; |
||
53 | |||
54 | /** |
||
55 | * @var string[] |
||
56 | */ |
||
57 | protected $mandatoryClaims = []; |
||
58 | |||
59 | protected function __construct(string $token) |
||
65 | |||
66 | /** |
||
67 | * @param string[] $mandatoryClaims |
||
68 | */ |
||
69 | public function mandatory(array $mandatoryClaims): self |
||
76 | |||
77 | public function aud(string $aud, bool $inHeader = false): self |
||
81 | |||
82 | public function iss(string $iss, bool $inHeader = false): self |
||
86 | |||
87 | public function jti(string $jti, bool $inHeader = false): self |
||
91 | |||
92 | public function sub(string $sub, bool $inHeader = false): self |
||
96 | |||
97 | /** |
||
98 | * @param null|array|callable|Checker\ClaimChecker $checker |
||
99 | */ |
||
100 | public function claim(string $key, $checker, bool $inHeader = false): self |
||
131 | |||
132 | /** |
||
133 | * @param false|int $leeway |
||
134 | * |
||
135 | * @throws InvalidArgumentException if the leeway is negative, not an integer or not false |
||
136 | */ |
||
137 | public function exp($leeway = 0, bool $inHeader = false): self |
||
151 | |||
152 | /** |
||
153 | * @param false|int $leeway |
||
154 | * |
||
155 | * @throws InvalidArgumentException if the leeway is negative, not an integer or not false |
||
156 | */ |
||
157 | public function nbf($leeway = 0, bool $inHeader = false): self |
||
171 | |||
172 | /** |
||
173 | * @param false|int $leeway |
||
174 | * |
||
175 | * @throws InvalidArgumentException if the leeway is negative, not an integer or not false |
||
176 | */ |
||
177 | public function iat($leeway = 0, bool $inHeader = false): self |
||
191 | |||
192 | /** |
||
193 | * @param Algorithm|string $alg |
||
194 | * |
||
195 | * @throws InvalidArgumentException if the algorithm is not a string or an instance of Jose\Component\Core\Algorithm |
||
196 | */ |
||
197 | public function alg($alg): self |
||
214 | |||
215 | /** |
||
216 | * @param Algorithm[]|string[] $algs |
||
217 | */ |
||
218 | public function algs($algs): self |
||
227 | |||
228 | /** |
||
229 | * @param array|callable|Checker\HeaderChecker|false|mixed $checker |
||
230 | */ |
||
231 | public function header(string $key, $checker): self |
||
259 | |||
260 | public function key(JWK $jwk): self |
||
268 | |||
269 | public function keyset(JWKSet $jwkset): self |
||
276 | } |
||
277 |