mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-03 10:41:51 +05:30
Updated AuthCodeRepositoryInterface
This commit is contained in:
parent
be14b3a2df
commit
d468cbf600
@ -16,6 +16,7 @@ use League\Container\ContainerAwareInterface;
|
|||||||
use League\Container\ContainerAwareTrait;
|
use League\Container\ContainerAwareTrait;
|
||||||
use League\Event\EmitterAwareInterface;
|
use League\Event\EmitterAwareInterface;
|
||||||
use League\Event\EmitterTrait;
|
use League\Event\EmitterTrait;
|
||||||
|
use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface;
|
||||||
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
|
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
|
||||||
use League\OAuth2\Server\Repositories\RepositoryInterface;
|
use League\OAuth2\Server\Repositories\RepositoryInterface;
|
||||||
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
||||||
@ -98,6 +99,9 @@ abstract class AbstractServer implements ContainerAwareInterface, EmitterAwareIn
|
|||||||
case ($repository instanceof UserRepositoryInterface):
|
case ($repository instanceof UserRepositoryInterface):
|
||||||
$this->getContainer()->add('UserRepository', $repository);
|
$this->getContainer()->add('UserRepository', $repository);
|
||||||
break;
|
break;
|
||||||
|
case ($repository instanceof AuthCodeRepositoryInterface):
|
||||||
|
$this->getContainer()->add('AuthCodeRepository', $repository);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,22 +9,21 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace League\OAuth2\Server\Storage;
|
namespace League\OAuth2\Server\Repositories;
|
||||||
|
|
||||||
use League\OAuth2\Server\Entity\AuthCodeEntity;
|
use League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface;
|
||||||
use League\OAuth2\Server\Entity\ScopeEntity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auth code storage interface
|
* Auth code storage interface
|
||||||
*/
|
*/
|
||||||
interface AuthCodeInterface extends StorageInterface
|
interface AuthCodeRepositoryInterface extends RepositoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get the auth code
|
* Get the auth code
|
||||||
*
|
*
|
||||||
* @param string $code
|
* @param string $code
|
||||||
*
|
*
|
||||||
* @return \League\OAuth2\Server\Entity\AuthCodeEntity
|
* @return \League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface
|
||||||
*/
|
*/
|
||||||
public function get($code);
|
public function get($code);
|
||||||
|
|
||||||
@ -40,31 +39,10 @@ interface AuthCodeInterface extends StorageInterface
|
|||||||
*/
|
*/
|
||||||
public function create($token, $expireTime, $sessionId, $redirectUri);
|
public function create($token, $expireTime, $sessionId, $redirectUri);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the scopes for an access token
|
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The auth code
|
|
||||||
*
|
|
||||||
* @return array Array of \League\OAuth2\Server\Entity\ScopeEntity
|
|
||||||
*/
|
|
||||||
public function getScopes(AuthCodeEntity $token);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Associate a scope with an acess token
|
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The auth code
|
|
||||||
* @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function associateScope(AuthCodeEntity $token, ScopeEntity $scope);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete an access token
|
* Delete an access token
|
||||||
*
|
*
|
||||||
* @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The access token to delete
|
* @param \League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface $token The access token to delete
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function delete(AuthCodeEntity $token);
|
public function delete(AuthCodeEntityInterface $token);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user