mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-25 00:20:41 -06:00
Make name required in ApiKey entity
This commit is contained in:
parent
1b9c8377ae
commit
f6d70c599e
@ -41,7 +41,7 @@ final readonly class ApiKeyMeta
|
|||||||
|
|
||||||
// If a name was not provided, fall back to the key
|
// If a name was not provided, fall back to the key
|
||||||
if (empty($name)) {
|
if (empty($name)) {
|
||||||
// If the key was auto-generated, fall back to a "censored" version of the UUID, otherwise simply use the
|
// If the key was auto-generated, fall back to a redacted version of the UUID, otherwise simply use the
|
||||||
// plain key as fallback name
|
// plain key as fallback name
|
||||||
$name = $key === null
|
$name = $key === null
|
||||||
? sprintf('%s-****-****-****-************', substr($resolvedKey, offset: 0, length: 8))
|
? sprintf('%s-****-****-****-************', substr($resolvedKey, offset: 0, length: 8))
|
||||||
|
@ -24,7 +24,7 @@ class ApiKey extends AbstractEntity
|
|||||||
*/
|
*/
|
||||||
private function __construct(
|
private function __construct(
|
||||||
public readonly string $key,
|
public readonly string $key,
|
||||||
public readonly string|null $name = null,
|
public readonly string $name,
|
||||||
public readonly Chronos|null $expirationDate = null,
|
public readonly Chronos|null $expirationDate = null,
|
||||||
private bool $enabled = true,
|
private bool $enabled = true,
|
||||||
private Collection $roles = new ArrayCollection(),
|
private Collection $roles = new ArrayCollection(),
|
||||||
|
Loading…
Reference in New Issue
Block a user