Feature/name api keys

This commit is contained in:
KetchupBomb
2021-03-06 17:27:34 +00:00
parent 65f2ab6720
commit b93b14986e
10 changed files with 163 additions and 40 deletions

View File

@@ -21,9 +21,12 @@ class ApiKeyService implements ApiKeyServiceInterface
$this->em = $em;
}
public function create(?Chronos $expirationDate = null, RoleDefinition ...$roleDefinitions): ApiKey
{
$key = new ApiKey($expirationDate);
public function create(
?Chronos $expirationDate = null,
?string $name = null,
RoleDefinition ...$roleDefinitions
): ApiKey {
$key = new ApiKey($expirationDate, $name);
foreach ($roleDefinitions as $definition) {
$key->registerRole($definition);
}