Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\Api\Domain\Repository; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use App\Core\Api\Domain\Model\ApiKey; |
| 12 | |
| 13 | /** |
| 14 | * API Key Domain Repository Interface. |
| 15 | * |
| 16 | * Defines contracts for loading and auditing API client keys. |
| 17 | * |
| 18 | * @package App\Core\Api\Domain\Repository |
| 19 | */ |
| 20 | interface ApiKeyRepositoryInterface |
| 21 | { |
| 22 | /** |
| 23 | * Finds active API key matching raw bearer token. |
| 24 | * |
| 25 | * @param string $rawToken Bearer token from request. |
| 26 | * @return ApiKey|null Found valid API key entity or null. |
| 27 | */ |
| 28 | public function findByToken(string $rawToken): ?ApiKey; |
| 29 | |
| 30 | /** |
| 31 | * Records timestamp of successful API key usage. |
| 32 | * |
| 33 | * @param int $id API key primary identifier. |
| 34 | * @return void |
| 35 | */ |
| 36 | public function touchLastUsed(int $id): void; |
| 37 | } |