Add new command to delete API keys

This commit is contained in:
Alejandro Celaya
2025-10-20 09:58:21 +02:00
parent cae18ccfb3
commit b5a9353b85
10 changed files with 276 additions and 4 deletions

View File

@@ -68,6 +68,17 @@ readonly class ApiKeyService implements ApiKeyServiceInterface
return new ApiKeyCheckResult($apiKey);
}
/**
* @inheritDoc
*/
public function deleteByName(string $apiKeyName): void
{
$affectedResults = $this->repo->deleteByName($apiKeyName);
if ($affectedResults === 0) {
throw ApiKeyNotFoundException::forName($apiKeyName);
}
}
/**
* @inheritDoc
*/