mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-02-24 11:48:03 +05:30
Updated repository method names
This commit is contained in:
parent
3135f1796e
commit
a2bbb17483
@ -12,31 +12,12 @@
|
|||||||
namespace League\OAuth2\Server\Repositories;
|
namespace League\OAuth2\Server\Repositories;
|
||||||
|
|
||||||
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
|
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
|
||||||
use League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access token interface
|
* Access token interface
|
||||||
*/
|
*/
|
||||||
interface AccessTokenRepositoryInterface extends RepositoryInterface
|
interface AccessTokenRepositoryInterface extends RepositoryInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Get an instance of Entity\AccessTokenEntity
|
|
||||||
*
|
|
||||||
* @param string $token The access token identifier
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
|
|
||||||
*/
|
|
||||||
public function getAccessTokenEntityByTokenString($token);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the scopes for an access token
|
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $token
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface[]
|
|
||||||
*/
|
|
||||||
public function getScopeEntitiesAssociatedWithAccessToken(AccessTokenEntityInterface $token);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persists a new access token to permanent storage
|
* Persists a new access token to permanent storage
|
||||||
*
|
*
|
||||||
@ -45,20 +26,18 @@ interface AccessTokenRepositoryInterface extends RepositoryInterface
|
|||||||
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity);
|
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associate a scope with an access token
|
* Revoke an access token
|
||||||
*
|
*
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessTokenEntityInterface
|
* @param string $tokenId
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface $scope
|
|
||||||
*/
|
*/
|
||||||
public function associateScopeWithAccessToken(
|
public function revokeAccessToken($tokenId);
|
||||||
AccessTokenEntityInterface $accessTokenEntityInterface,
|
|
||||||
ScopeEntityInterface $scope
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete an access token
|
* Check if the access token has been revoked
|
||||||
*
|
*
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken
|
* @param string $tokenId
|
||||||
|
*
|
||||||
|
* @return bool Return true if this token has been revoked
|
||||||
*/
|
*/
|
||||||
public function deleteAccessToken(AccessTokenEntityInterface $accessToken);
|
public function isAccessTokenRevoked($tokenId);
|
||||||
}
|
}
|
||||||
|
@ -18,30 +18,26 @@ use League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface;
|
|||||||
*/
|
*/
|
||||||
interface RefreshTokenRepositoryInterface extends RepositoryInterface
|
interface RefreshTokenRepositoryInterface extends RepositoryInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Return a new instance of \League\OAuth2\Server\Entity\RefreshTokenEntity
|
|
||||||
*
|
|
||||||
* @param string $token Refresh token string
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface
|
|
||||||
*/
|
|
||||||
public function getRefreshTokenEntityByTokenString($token);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new refresh token_name
|
* Create a new refresh token_name
|
||||||
*
|
*
|
||||||
* @param string $token
|
* @param \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface $refreshTokenEntityInterface
|
||||||
* @param integer $expireTime
|
|
||||||
* @param string $accessToken
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface
|
|
||||||
*/
|
*/
|
||||||
public function persistNewRefreshTokenEntity($token, $expireTime, $accessToken);
|
public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntityInterface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the refresh token
|
* Revoke the refresh token
|
||||||
*
|
*
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface $token
|
* @param string $tokenId
|
||||||
*/
|
*/
|
||||||
public function deleteRefreshTokenEntity(RefreshTokenEntityInterface $token);
|
public function revokeRefreshToken($tokenId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the refresh token has been revoked
|
||||||
|
*
|
||||||
|
* @param string $tokenId
|
||||||
|
*
|
||||||
|
* @return bool Return true if this token has been revoked
|
||||||
|
*/
|
||||||
|
public function isRefreshTokenRevoked($tokenId);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user