mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-03 10:41:51 +05:30
Updated example repositories to match updated interfaces
This commit is contained in:
parent
b95780022a
commit
96a0c34d41
@ -9,56 +9,43 @@ class AccessTokenRepository implements AccessTokenRepositoryInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an instance of Entity\AccessTokenEntity
|
* @inheritdoc
|
||||||
*
|
|
||||||
* @param string $tokenIdentifier The access token identifier
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
|
|
||||||
*/
|
*/
|
||||||
public function get($tokenIdentifier)
|
public function getAccessTokenEntityByTokenString($tokenIdentifier)
|
||||||
{
|
{
|
||||||
// TODO: Implement get() method.
|
// TODO: Implement get() method.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the scopes for an access token
|
* @inheritdoc
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $token
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface[]
|
|
||||||
*/
|
*/
|
||||||
public function getScopes(AccessTokenEntityInterface $token)
|
public function getScopeEntitiesAssociatedWithAccessToken(AccessTokenEntityInterface $token)
|
||||||
{
|
{
|
||||||
// TODO: Implement getScopes() method.
|
// TODO: Implement getScopes() method.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new access token
|
* @inheritdoc
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessTokenEntity
|
|
||||||
*/
|
*/
|
||||||
public function create(AccessTokenEntityInterface $accessTokenEntity)
|
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity)
|
||||||
{
|
{
|
||||||
// TODO: Implement create() method.
|
// TODO: Implement create() method.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associate a scope with an access token
|
* @inheritdoc
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessTokenEntityInterface
|
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface $scope
|
|
||||||
*/
|
*/
|
||||||
public function associateScope(AccessTokenEntityInterface $accessTokenEntityInterface, ScopeEntityInterface $scope)
|
public function associateScopeWithAccessToken(
|
||||||
{
|
AccessTokenEntityInterface $accessTokenEntityInterface,
|
||||||
|
ScopeEntityInterface $scope
|
||||||
|
) {
|
||||||
// TODO: Implement associateScope() method.
|
// TODO: Implement associateScope() method.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete an access token
|
* @inheritdoc
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken
|
|
||||||
*/
|
*/
|
||||||
public function delete(AccessTokenEntityInterface $accessToken)
|
public function deleteAccessToken(AccessTokenEntityInterface $accessToken)
|
||||||
{
|
{
|
||||||
// TODO: Implement delete() method.
|
// TODO: Implement delete() method.
|
||||||
}
|
}
|
||||||
|
@ -7,16 +7,9 @@ use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
|
|||||||
class ClientRepository implements ClientRepositoryInterface
|
class ClientRepository implements ClientRepositoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get a client
|
* @inheritdoc
|
||||||
*
|
|
||||||
* @param string $clientIdentifier The client's identifier
|
|
||||||
* @param string $clientSecret The client's secret (default = "null")
|
|
||||||
* @param string $redirectUri The client's redirect URI (default = "null")
|
|
||||||
* @param string $grantType The grant type used (default = "null")
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface
|
|
||||||
*/
|
*/
|
||||||
public function get($clientIdentifier, $clientSecret = null, $redirectUri = null, $grantType = null)
|
public function getClientEntity($clientIdentifier, $clientSecret = null, $redirectUri = null, $grantType = null)
|
||||||
{
|
{
|
||||||
$clients = [
|
$clients = [
|
||||||
'myawesomeapp' => [
|
'myawesomeapp' => [
|
||||||
|
@ -7,15 +7,9 @@ use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
|||||||
class ScopeRepository implements ScopeRepositoryInterface
|
class ScopeRepository implements ScopeRepositoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Return information about a scope
|
* @inheritdoc
|
||||||
*
|
|
||||||
* @param string $scopeIdentifier The scope identifier
|
|
||||||
* @param string $grantType The grant type used in the request (default = "null")
|
|
||||||
* @param string $clientId The client sending the request (default = "null")
|
|
||||||
*
|
|
||||||
* @return \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface
|
|
||||||
*/
|
*/
|
||||||
public function get($scopeIdentifier, $grantType = null, $clientId = null)
|
public function getScopeEntityByIdentifier($scopeIdentifier, $grantType, $clientId = null)
|
||||||
{
|
{
|
||||||
$scopes = [
|
$scopes = [
|
||||||
'basic' => [
|
'basic' => [
|
||||||
|
Loading…
Reference in New Issue
Block a user