mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-03 10:41:51 +05:30
Merge pull request #475 from thephpleague/analysis-zYjdLv
Applied fixes from StyleCI
This commit is contained in:
commit
c2e83ff359
@ -15,4 +15,4 @@ interface AuthorizationValidatorInterface
|
|||||||
* @return ServerRequestInterface
|
* @return ServerRequestInterface
|
||||||
*/
|
*/
|
||||||
public function validateAuthorization(ServerRequestInterface $request);
|
public function validateAuthorization(ServerRequestInterface $request);
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace League\OAuth2\Server\AuthorizationValidators;
|
namespace League\OAuth2\Server\AuthorizationValidators;
|
||||||
|
|
||||||
use League\OAuth2\Server\CryptTrait;
|
|
||||||
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
|
||||||
use Lcobucci\JWT\Parser;
|
use Lcobucci\JWT\Parser;
|
||||||
use Lcobucci\JWT\Signer\Rsa\Sha256;
|
use Lcobucci\JWT\Signer\Rsa\Sha256;
|
||||||
|
use League\OAuth2\Server\CryptTrait;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
|
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
class BearerTokenValidator implements AuthorizationValidatorInterface
|
class BearerTokenValidator implements AuthorizationValidatorInterface
|
||||||
{
|
{
|
||||||
@ -63,4 +63,4 @@ class BearerTokenValidator implements AuthorizationValidatorInterface
|
|||||||
throw OAuthServerException::accessDenied($exception->getMessage());
|
throw OAuthServerException::accessDenied($exception->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,4 +119,4 @@ trait CryptTrait
|
|||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ abstract class AbstractAuthorizeGrant extends AbstractGrant
|
|||||||
public function makeRedirectUri($uri, $params = [], $queryDelimiter = '?')
|
public function makeRedirectUri($uri, $params = [], $queryDelimiter = '?')
|
||||||
{
|
{
|
||||||
$uri .= (strstr($uri, $queryDelimiter) === false) ? $queryDelimiter : '&';
|
$uri .= (strstr($uri, $queryDelimiter) === false) ? $queryDelimiter : '&';
|
||||||
|
|
||||||
return $uri . http_build_query($params);
|
return $uri . http_build_query($params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,7 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
|
|||||||
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
||||||
$htmlResponse->setStatusCode(403);
|
$htmlResponse->setStatusCode(403);
|
||||||
$htmlResponse->setHtml($html);
|
$htmlResponse->setHtml($html);
|
||||||
|
|
||||||
return $htmlResponse;
|
return $htmlResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ class ImplicitGrant extends AbstractAuthorizeGrant
|
|||||||
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
||||||
$htmlResponse->setStatusCode(403);
|
$htmlResponse->setStatusCode(403);
|
||||||
$htmlResponse->setHtml($html);
|
$htmlResponse->setHtml($html);
|
||||||
|
|
||||||
return $htmlResponse;
|
return $htmlResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ class ImplicitGrant extends AbstractAuthorizeGrant
|
|||||||
'postback_uri' => $this->makeRedirectUri(
|
'postback_uri' => $this->makeRedirectUri(
|
||||||
$postbackUri,
|
$postbackUri,
|
||||||
$request->getQueryParams()
|
$request->getQueryParams()
|
||||||
)
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
||||||
|
@ -63,4 +63,4 @@ class HtmlResponse extends AbstractResponseType
|
|||||||
{
|
{
|
||||||
$this->headers[$key] = $value;
|
$this->headers[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,4 +28,4 @@ class RedirectResponse extends AbstractResponseType
|
|||||||
{
|
{
|
||||||
return $response->withStatus(302)->withHeader('location', $this->redirectUri);
|
return $response->withStatus(302)->withHeader('location', $this->redirectUri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,12 +69,12 @@ class Server implements EmitterAwareInterface
|
|||||||
/**
|
/**
|
||||||
* New server instance.
|
* New server instance.
|
||||||
*
|
*
|
||||||
* @param \League\OAuth2\Server\Repositories\ClientRepositoryInterface $clientRepository
|
* @param \League\OAuth2\Server\Repositories\ClientRepositoryInterface $clientRepository
|
||||||
* @param \League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface $accessTokenRepository
|
* @param \League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface $accessTokenRepository
|
||||||
* @param \League\OAuth2\Server\Repositories\ScopeRepositoryInterface $scopeRepository
|
* @param \League\OAuth2\Server\Repositories\ScopeRepositoryInterface $scopeRepository
|
||||||
* @param string $privateKeyPath
|
* @param string $privateKeyPath
|
||||||
* @param string $publicKeyPath
|
* @param string $publicKeyPath
|
||||||
* @param null|\League\OAuth2\Server\ResponseTypes\ResponseTypeInterface $responseType
|
* @param null|\League\OAuth2\Server\ResponseTypes\ResponseTypeInterface $responseType
|
||||||
* @param null|\League\OAuth2\Server\AuthorizationValidators\AuthorizationValidatorInterface $authorizationValidator
|
* @param null|\League\OAuth2\Server\AuthorizationValidators\AuthorizationValidatorInterface $authorizationValidator
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
Loading…
Reference in New Issue
Block a user