Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace LambdaTwelve\OneRecord\Client; |
| 6 | |
| 7 | /** |
| 8 | * Supplies the bearer token the client sends to one ONE Record server. The |
| 9 | * host decides where tokens come from: a client-credentials flow |
| 10 | * (ClientCredentialsTokenProvider), a fixed token (StaticTokenProvider) or |
| 11 | * its own scheme. |
| 12 | */ |
| 13 | interface TokenProvider |
| 14 | { |
| 15 | /** |
| 16 | * A token valid for the given server endpoint, fetched or refreshed as needed. |
| 17 | * |
| 18 | * @throws ClientException when no token can be obtained |
| 19 | */ |
| 20 | public function token(string $serverEndpoint): string; |
| 21 | } |