* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShopBundle\Security\OAuth2\Repository; use League\OAuth2\Server\Entities\AccessTokenEntityInterface; use League\OAuth2\Server\Entities\ClientEntityInterface; use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface; use PrestaShopBundle\Security\OAuth2\Entity\AccessToken; /** * Repository class responsible for managing PrestaShop's Authorization Server AccessToken entity * * @experimental */ class AccessTokenRepository implements AccessTokenRepositoryInterface { public function getNewToken( ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null ): AccessTokenEntityInterface { $token = new AccessToken(); $token->setClient($clientEntity); $token->setUserIdentifier($userIdentifier); return $token; } public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity): void { } public function revokeAccessToken($tokenId): void { // @ToDo: revoke AccessToken } public function isAccessTokenRevoked($tokenId): bool { // @ToDo: check if AccessToken is revoked return false; } }