Improve scope checking

Whether the scopes are defined as a space separated string, or an array,
we should now be checking them without any errors.
This commit is contained in:
Jonny Barnes 2024-07-13 14:52:57 +01:00
parent 55afa8f01d
commit baee7ade4f
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
3 changed files with 29 additions and 7 deletions

View file

@ -14,8 +14,8 @@ trait TestToken
return $config->builder()
->issuedAt(new DateTimeImmutable())
->withClaim('client_id', 'https://quill.p3k.io')
->withClaim('me', 'https://jonnybarnes.localhost')
->withClaim('scope', 'create update')
->withClaim('me', 'http://jonnybarnes.localhost')
->withClaim('scope', ['create', 'update'])
->getToken($config->signer(), $config->signingKey())
->toString();
}