mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Applied fixes from StyleCI
This commit is contained in:
parent
f007e25070
commit
77737e7894
@ -7,9 +7,9 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Grant\AuthCodeGrant;
|
use League\OAuth2\Server\Grant\AuthCodeGrant;
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
|
||||||
use OAuth2ServerExamples\Entities\UserEntity;
|
use OAuth2ServerExamples\Entities\UserEntity;
|
||||||
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
||||||
use OAuth2ServerExamples\Repositories\AuthCodeRepository;
|
use OAuth2ServerExamples\Repositories\AuthCodeRepository;
|
||||||
|
@ -62,12 +62,10 @@ $app->post('/access_token', function (ServerRequestInterface $request, ResponseI
|
|||||||
|
|
||||||
// Try to respond to the request
|
// Try to respond to the request
|
||||||
return $server->respondToAccessTokenRequest($request, $response);
|
return $server->respondToAccessTokenRequest($request, $response);
|
||||||
|
|
||||||
} catch (OAuthServerException $exception) {
|
} catch (OAuthServerException $exception) {
|
||||||
|
|
||||||
// All instances of OAuthServerException can be formatted into a HTTP response
|
// All instances of OAuthServerException can be formatted into a HTTP response
|
||||||
return $exception->generateHttpResponse($response);
|
return $exception->generateHttpResponse($response);
|
||||||
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
|
|
||||||
// Unknown exception
|
// Unknown exception
|
||||||
@ -75,7 +73,6 @@ $app->post('/access_token', function (ServerRequestInterface $request, ResponseI
|
|||||||
$body->write($exception->getMessage());
|
$body->write($exception->getMessage());
|
||||||
|
|
||||||
return $response->withStatus(500)->withBody($body);
|
return $response->withStatus(500)->withBody($body);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Grant\ImplicitGrant;
|
use League\OAuth2\Server\Grant\ImplicitGrant;
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
|
||||||
use OAuth2ServerExamples\Entities\UserEntity;
|
use OAuth2ServerExamples\Entities\UserEntity;
|
||||||
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
||||||
use OAuth2ServerExamples\Repositories\ClientRepository;
|
use OAuth2ServerExamples\Repositories\ClientRepository;
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
use League\OAuth2\Server\Grant\AuthCodeGrant;
|
use League\OAuth2\Server\Grant\AuthCodeGrant;
|
||||||
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
||||||
use League\OAuth2\Server\Middleware\AuthorizationServerMiddleware;
|
use League\OAuth2\Server\Middleware\AuthorizationServerMiddleware;
|
||||||
use League\OAuth2\Server\Middleware\ResourceServerMiddleware;
|
use League\OAuth2\Server\Middleware\ResourceServerMiddleware;
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
|
||||||
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
||||||
use OAuth2ServerExamples\Repositories\AuthCodeRepository;
|
use OAuth2ServerExamples\Repositories\AuthCodeRepository;
|
||||||
use OAuth2ServerExamples\Repositories\ClientRepository;
|
use OAuth2ServerExamples\Repositories\ClientRepository;
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Grant\PasswordGrant;
|
use League\OAuth2\Server\Grant\PasswordGrant;
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
|
||||||
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
||||||
use OAuth2ServerExamples\Repositories\ClientRepository;
|
use OAuth2ServerExamples\Repositories\ClientRepository;
|
||||||
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
|
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
* @link https://github.com/thephpleague/oauth2-server
|
* @link https://github.com/thephpleague/oauth2-server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
|
||||||
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
|
||||||
use OAuth2ServerExamples\Repositories\ClientRepository;
|
use OAuth2ServerExamples\Repositories\ClientRepository;
|
||||||
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
|
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
namespace League\OAuth2\Server\Middleware;
|
namespace League\OAuth2\Server\Middleware;
|
||||||
|
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace LeagueTests;
|
namespace LeagueTests;
|
||||||
|
|
||||||
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
use League\OAuth2\Server\CryptKey;
|
use League\OAuth2\Server\CryptKey;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Grant\AuthCodeGrant;
|
use League\OAuth2\Server\Grant\AuthCodeGrant;
|
||||||
@ -13,7 +14,6 @@ use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
|
|||||||
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
||||||
use League\OAuth2\Server\RequestTypes\AuthorizationRequest;
|
use League\OAuth2\Server\RequestTypes\AuthorizationRequest;
|
||||||
use League\OAuth2\Server\ResponseTypes\BearerTokenResponse;
|
use League\OAuth2\Server\ResponseTypes\BearerTokenResponse;
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
|
||||||
use LeagueTests\Stubs\AccessTokenEntity;
|
use LeagueTests\Stubs\AccessTokenEntity;
|
||||||
use LeagueTests\Stubs\AuthCodeEntity;
|
use LeagueTests\Stubs\AuthCodeEntity;
|
||||||
use LeagueTests\Stubs\ClientEntity;
|
use LeagueTests\Stubs\ClientEntity;
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace LeagueTests\Middleware;
|
namespace LeagueTests\Middleware;
|
||||||
|
|
||||||
|
use League\OAuth2\Server\AuthorizationServer;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Grant\ClientCredentialsGrant;
|
use League\OAuth2\Server\Grant\ClientCredentialsGrant;
|
||||||
use League\OAuth2\Server\Middleware\AuthorizationServerMiddleware;
|
use League\OAuth2\Server\Middleware\AuthorizationServerMiddleware;
|
||||||
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
||||||
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
|
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
|
||||||
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
|
||||||
use League\OAuth2\Server\AuthorizationServer;
|
|
||||||
use LeagueTests\Stubs\AccessTokenEntity;
|
use LeagueTests\Stubs\AccessTokenEntity;
|
||||||
use LeagueTests\Stubs\ClientEntity;
|
use LeagueTests\Stubs\ClientEntity;
|
||||||
use LeagueTests\Stubs\StubResponseType;
|
use LeagueTests\Stubs\StubResponseType;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
namespace LeagueTests;
|
namespace LeagueTests;
|
||||||
|
|
||||||
|
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
||||||
use League\OAuth2\Server\ResourceServer;
|
use League\OAuth2\Server\ResourceServer;
|
||||||
@ -24,5 +23,4 @@ class ResourceServerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals('Missing "Authorization" header', $e->getHint());
|
$this->assertEquals('Missing "Authorization" header', $e->getHint());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user