mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
29 lines
622 B
PHP
29 lines
622 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Rest\Service;
|
|
|
|
use Cake\Chronos\Chronos;
|
|
use Shlinkio\Shlink\Common\Exception\InvalidArgumentException;
|
|
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
|
|
|
interface ApiKeyServiceInterface
|
|
{
|
|
public function create(?Chronos $expirationDate = null): ApiKey;
|
|
|
|
public function check(string $key): bool;
|
|
|
|
/**
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function disable(string $key): ApiKey;
|
|
|
|
/**
|
|
* @return ApiKey[]
|
|
*/
|
|
public function listKeys(bool $enabledOnly = false): array;
|
|
|
|
public function getByKey(string $key): ?ApiKey;
|
|
}
|