mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-05 19:43:56 +05:30
Namespace renamed TokenType > TokenTypes
This commit is contained in:
parent
7c57310b67
commit
027971776b
@ -9,12 +9,11 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace League\OAuth2\Server\TokenType;
|
namespace League\OAuth2\Server\TokenTypes;
|
||||||
|
|
||||||
use League\OAuth2\Server\AbstractServer;
|
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
|
||||||
use League\OAuth2\Server\Entity\SessionEntity;
|
|
||||||
|
|
||||||
abstract class AbstractTokenType
|
abstract class AbstractTokenType implements TokenTypeInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Response array
|
* Response array
|
||||||
@ -24,38 +23,9 @@ abstract class AbstractTokenType
|
|||||||
protected $response = [];
|
protected $response = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server
|
* @var \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
|
||||||
*
|
|
||||||
* @var \League\OAuth2\Server\AbstractServer $server
|
|
||||||
*/
|
*/
|
||||||
protected $server;
|
protected $accessToken;
|
||||||
|
|
||||||
/**
|
|
||||||
* Server
|
|
||||||
*
|
|
||||||
* @var \League\OAuth2\Server\Entity\SessionEntity $session
|
|
||||||
*/
|
|
||||||
protected $session;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function setServer(AbstractServer $server)
|
|
||||||
{
|
|
||||||
$this->server = $server;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function setSession(SessionEntity $session)
|
|
||||||
{
|
|
||||||
$this->session = $session;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
@ -72,4 +42,12 @@ abstract class AbstractTokenType
|
|||||||
{
|
{
|
||||||
return isset($this->response[$key]) ? $this->response[$key] : null;
|
return isset($this->response[$key]) ? $this->response[$key] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken
|
||||||
|
*/
|
||||||
|
public function setAccessToken(AccessTokenEntityInterface $accessToken)
|
||||||
|
{
|
||||||
|
$this->accessToken = $accessToken;
|
||||||
|
}
|
||||||
}
|
}
|
@ -9,11 +9,11 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace League\OAuth2\Server\TokenType;
|
namespace League\OAuth2\Server\TokenTypes;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class Bearer extends AbstractTokenType implements TokenTypeInterface
|
class Bearer extends AbstractTokenType
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
@ -9,7 +9,7 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace League\OAuth2\Server\TokenType;
|
namespace League\OAuth2\Server\TokenTypes;
|
||||||
|
|
||||||
use League\OAuth2\Server\Util\SecureKey;
|
use League\OAuth2\Server\Util\SecureKey;
|
||||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
use Symfony\Component\HttpFoundation\ParameterBag;
|
@ -9,9 +9,10 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace League\OAuth2\Server\TokenType;
|
namespace League\OAuth2\Server\TokenTypes;
|
||||||
|
|
||||||
use League\OAuth2\Server\AbstractServer;
|
use League\OAuth2\Server\AbstractServer;
|
||||||
|
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
|
||||||
use League\OAuth2\Server\Entity\SessionEntity;
|
use League\OAuth2\Server\Entity\SessionEntity;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
@ -25,13 +26,9 @@ interface TokenTypeInterface
|
|||||||
public function generateResponse();
|
public function generateResponse();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the server
|
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken
|
||||||
*
|
|
||||||
* @param \League\OAuth2\Server\AbstractServer $server
|
|
||||||
*
|
|
||||||
* @return self
|
|
||||||
*/
|
*/
|
||||||
public function setServer(AbstractServer $server);
|
public function setAccessToken(AccessTokenEntityInterface $accessToken);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a key/value response pair
|
* Set a key/value response pair
|
||||||
@ -50,13 +47,6 @@ interface TokenTypeInterface
|
|||||||
*/
|
*/
|
||||||
public function getParam($key);
|
public function getParam($key);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param \League\OAuth2\Server\Entity\SessionEntity $session
|
|
||||||
*
|
|
||||||
* @return self
|
|
||||||
*/
|
|
||||||
public function setSession(SessionEntity $session);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the access token in the authorization header
|
* Determine the access token in the authorization header
|
||||||
*
|
*
|
Loading…
Reference in New Issue
Block a user