Allow API keys to be renamed

This commit is contained in:
Alejandro Celaya
2024-11-08 08:25:07 +01:00
parent 9e6f129de6
commit a661d05100
14 changed files with 132 additions and 31 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Rest\Service;
use Shlinkio\Shlink\Common\Exception\InvalidArgumentException;
use Shlinkio\Shlink\Core\Model\Renaming;
use Shlinkio\Shlink\Rest\ApiKey\Model\ApiKeyMeta;
use Shlinkio\Shlink\Rest\Entity\ApiKey;
@@ -36,4 +37,9 @@ interface ApiKeyServiceInterface
* Check if an API key exists for provided name
*/
public function existsWithName(string $apiKeyName): bool;
/**
* @throws InvalidArgumentException If an API key with oldName does not exist, or newName is in use by another one
*/
public function renameApiKey(Renaming $apiKeyRenaming): ApiKey;
}