aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php')
-rw-r--r--vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php49
1 files changed, 47 insertions, 2 deletions
diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php
index 3cfaaaf12..926f90fda 100644
--- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php
+++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php
@@ -10,17 +10,43 @@ use OAuth2\ResponseInterface;
use OAuth2\Scope;
/**
- * @see OAuth2\Controller\ResourceControllerInterface
+ * @see ResourceControllerInterface
*/
class ResourceController implements ResourceControllerInterface
{
+ /**
+ * @var array
+ */
private $token;
+ /**
+ * @var TokenTypeInterface
+ */
protected $tokenType;
+
+ /**
+ * @var AccessTokenInterface
+ */
protected $tokenStorage;
+
+ /**
+ * @var array
+ */
protected $config;
+
+ /**
+ * @var ScopeInterface
+ */
protected $scopeUtil;
+ /**
+ * Constructor
+ *
+ * @param TokenTypeInterface $tokenType
+ * @param AccessTokenInterface $tokenStorage
+ * @param array $config
+ * @param ScopeInterface $scopeUtil
+ */
public function __construct(TokenTypeInterface $tokenType, AccessTokenInterface $tokenStorage, $config = array(), ScopeInterface $scopeUtil = null)
{
$this->tokenType = $tokenType;
@@ -36,6 +62,14 @@ class ResourceController implements ResourceControllerInterface
$this->scopeUtil = $scopeUtil;
}
+ /**
+ * Verify the resource request
+ *
+ * @param RequestInterface $request
+ * @param ResponseInterface $response
+ * @param null $scope
+ * @return bool
+ */
public function verifyResourceRequest(RequestInterface $request, ResponseInterface $response, $scope = null)
{
$token = $this->getAccessTokenData($request, $response);
@@ -71,6 +105,13 @@ class ResourceController implements ResourceControllerInterface
return (bool) $token;
}
+ /**
+ * Get access token data.
+ *
+ * @param RequestInterface $request
+ * @param ResponseInterface $response
+ * @return array|null
+ */
public function getAccessTokenData(RequestInterface $request, ResponseInterface $response)
{
// Get the token parameter
@@ -103,7 +144,11 @@ class ResourceController implements ResourceControllerInterface
return null;
}
- // convenience method to allow retrieval of the token
+ /**
+ * convenience method to allow retrieval of the token.
+ *
+ * @return array
+ */
public function getToken()
{
return $this->token;