mirror of
				https://github.com/elyby/oauth2-server.git
				synced 2025-05-31 14:12:07 +05:30 
			
		
		
		
	Updated AuthCodeRepositoryInterface
This commit is contained in:
		| @@ -16,6 +16,7 @@ use League\Container\ContainerAwareInterface; | ||||
| use League\Container\ContainerAwareTrait; | ||||
| use League\Event\EmitterAwareInterface; | ||||
| use League\Event\EmitterTrait; | ||||
| use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface; | ||||
| use League\OAuth2\Server\Repositories\ClientRepositoryInterface; | ||||
| use League\OAuth2\Server\Repositories\RepositoryInterface; | ||||
| use League\OAuth2\Server\Repositories\ScopeRepositoryInterface; | ||||
| @@ -98,6 +99,9 @@ abstract class AbstractServer implements ContainerAwareInterface, EmitterAwareIn | ||||
|             case ($repository instanceof UserRepositoryInterface): | ||||
|                 $this->getContainer()->add('UserRepository', $repository); | ||||
|                 break; | ||||
|             case ($repository instanceof AuthCodeRepositoryInterface): | ||||
|                 $this->getContainer()->add('AuthCodeRepository', $repository); | ||||
|                 break; | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -9,22 +9,21 @@ | ||||
|  * @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\Entity\ScopeEntity; | ||||
| use League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface; | ||||
|  | ||||
| /** | ||||
|  * Auth code storage interface | ||||
|  */ | ||||
| interface AuthCodeInterface extends StorageInterface | ||||
| interface AuthCodeRepositoryInterface extends RepositoryInterface | ||||
| { | ||||
|     /** | ||||
|      * Get the auth code | ||||
|      * | ||||
|      * @param string $code | ||||
|      * | ||||
|      * @return \League\OAuth2\Server\Entity\AuthCodeEntity | ||||
|      * @return \League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface | ||||
|      */ | ||||
|     public function get($code); | ||||
|  | ||||
| @@ -40,31 +39,10 @@ interface AuthCodeInterface extends StorageInterface | ||||
|      */ | ||||
|     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 | ||||
|      * | ||||
|      * @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The access token to delete | ||||
|      * | ||||
|      * @return void | ||||
|      * @param \League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface $token The access token to delete | ||||
|      */ | ||||
|     public function delete(AuthCodeEntity $token); | ||||
|     public function delete(AuthCodeEntityInterface $token); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user