mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Renamed AuthServer to Authorization, renamed ResourceServer to Resource. Updated all tests and other files
This commit is contained in:
@@ -9,19 +9,19 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2;
|
||||
namespace League\OAuth2\Server;
|
||||
|
||||
use League\OAuth2\Util\Request;
|
||||
use League\OAuth2\Util\SecureKey;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Grant\GrantTypeInterface;
|
||||
use League\OAuth2\Server\Util\Request;
|
||||
use League\OAuth2\Server\Util\SecureKey;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Grant\GrantTypeInterface;
|
||||
|
||||
/**
|
||||
* OAuth 2.0 authorization server class
|
||||
*/
|
||||
class AuthServer
|
||||
class Authorization
|
||||
{
|
||||
/**
|
||||
* The delimeter between scopes specified in the scope query string parameter
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Exception;
|
||||
namespace League\OAuth2\Server\Exception;
|
||||
|
||||
/**
|
||||
* ClientException Exception
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Exception;
|
||||
namespace League\OAuth2\Server\Exception;
|
||||
|
||||
/**
|
||||
* InvalidAccessToken Exception
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Exception;
|
||||
namespace League\OAuth2\Server\Exception;
|
||||
|
||||
/**
|
||||
* InvalidGrantTypeException Exception
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Exception;
|
||||
namespace League\OAuth2\Server\Exception;
|
||||
|
||||
/**
|
||||
* Exception class
|
||||
|
@@ -9,15 +9,15 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Grant;
|
||||
namespace League\OAuth2\Server\Grant;
|
||||
|
||||
use League\OAuth2\Request;
|
||||
use League\OAuth2\AuthServer;
|
||||
use League\OAuth2\Exception;
|
||||
use League\OAuth2\Util\SecureKey;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Request;
|
||||
use League\OAuth2\Server\Authorization;
|
||||
use League\OAuth2\Server\Exception;
|
||||
use League\OAuth2\Server\Util\SecureKey;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
/**
|
||||
* Auth code grant class
|
||||
@@ -59,7 +59,7 @@ class AuthCode implements GrantTypeInterface {
|
||||
* @param AuthServer $authServer AuthServer instance
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AuthServer $authServer)
|
||||
public function __construct(Authorization $authServer)
|
||||
{
|
||||
$this->authServer = $authServer;
|
||||
}
|
||||
|
@@ -9,15 +9,15 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Grant;
|
||||
namespace League\OAuth2\Server\Grant;
|
||||
|
||||
use League\OAuth2\Request;
|
||||
use League\OAuth2\AuthServer;
|
||||
use League\OAuth2\Exception;
|
||||
use League\OAuth2\Util\SecureKey;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Request;
|
||||
use League\OAuth2\Server\Authorization;
|
||||
use League\OAuth2\Server\Exception;
|
||||
use League\OAuth2\Server\Util\SecureKey;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
/**
|
||||
* Client credentials grant class
|
||||
@@ -53,7 +53,7 @@ class ClientCredentials implements GrantTypeInterface {
|
||||
* @param AuthServer $authServer AuthServer instance
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AuthServer $authServer)
|
||||
public function __construct(Authorization $authServer)
|
||||
{
|
||||
$this->authServer = $authServer;
|
||||
}
|
||||
@@ -97,18 +97,18 @@ class ClientCredentials implements GrantTypeInterface {
|
||||
$authParams = $this->authServer->getParam(array('client_id', 'client_secret'), 'post', $inputParams);
|
||||
|
||||
if (is_null($authParams['client_id'])) {
|
||||
throw new Exception\ClientException(sprintf(AuthServer::getExceptionMessage('invalid_request'), 'client_id'), 0);
|
||||
throw new Exception\ClientException(sprintf(Authorization::getExceptionMessage('invalid_request'), 'client_id'), 0);
|
||||
}
|
||||
|
||||
if (is_null($authParams['client_secret'])) {
|
||||
throw new Exception\ClientException(sprintf(AuthServer::getExceptionMessage('invalid_request'), 'client_secret'), 0);
|
||||
throw new Exception\ClientException(sprintf(Authorization::getExceptionMessage('invalid_request'), 'client_secret'), 0);
|
||||
}
|
||||
|
||||
// Validate client ID and client secret
|
||||
$clientDetails = $this->authServer->getStorage('client')->getClient($authParams['client_id'], $authParams['client_secret'], null, $this->identifier);
|
||||
|
||||
if ($clientDetails === false) {
|
||||
throw new Exception\ClientException(AuthServer::getExceptionMessage('invalid_client'), 8);
|
||||
throw new Exception\ClientException(Authorization::getExceptionMessage('invalid_client'), 8);
|
||||
}
|
||||
|
||||
$authParams['client_details'] = $clientDetails;
|
||||
|
@@ -9,15 +9,15 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Grant;
|
||||
namespace League\OAuth2\Server\Grant;
|
||||
|
||||
use League\OAuth2\Request;
|
||||
use League\OAuth2\AuthServer;
|
||||
use League\OAuth2\Exception;
|
||||
use League\OAuth2\Util\SecureKey;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Request;
|
||||
use League\OAuth2\Server\Authorization;
|
||||
use League\OAuth2\Server\Exception;
|
||||
use League\OAuth2\Server\Util\SecureKey;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
interface GrantTypeInterface
|
||||
{
|
||||
@@ -26,7 +26,7 @@ interface GrantTypeInterface
|
||||
* @param AuthServer $authServer AuthServer instance
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AuthServer $authServer);
|
||||
public function __construct(Authorization $authServer);
|
||||
|
||||
/**
|
||||
* Returns the grant identifier (used to validate grant_type in OAuth2\AuthServer\issueAccessToken())
|
||||
|
@@ -9,15 +9,15 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Grant;
|
||||
namespace League\OAuth2\Server\Grant;
|
||||
|
||||
use League\OAuth2\Request;
|
||||
use League\OAuth2\AuthServer;
|
||||
use League\OAuth2\Exception;
|
||||
use League\OAuth2\Util\SecureKey;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Request;
|
||||
use League\OAuth2\Server\Authorization;
|
||||
use League\OAuth2\Server\Exception;
|
||||
use League\OAuth2\Server\Util\SecureKey;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
/**
|
||||
* Client credentials grant class
|
||||
@@ -47,7 +47,7 @@ class Implict implements GrantTypeInterface {
|
||||
* @param AuthServer $authServer AuthServer instance
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AuthServer $authServer)
|
||||
public function __construct(Authorization $authServer)
|
||||
{
|
||||
$this->authServer = $authServer;
|
||||
}
|
||||
|
@@ -9,15 +9,15 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Grant;
|
||||
namespace League\OAuth2\Server\Grant;
|
||||
|
||||
use League\OAuth2\Request;
|
||||
use League\OAuth2\AuthServer;
|
||||
use League\OAuth2\Exception;
|
||||
use League\OAuth2\Util\SecureKey;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Request;
|
||||
use League\OAuth2\Server\Authorization;
|
||||
use League\OAuth2\Server\Exception;
|
||||
use League\OAuth2\Server\Util\SecureKey;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
/**
|
||||
* Password grant class
|
||||
@@ -59,7 +59,7 @@ class Password implements GrantTypeInterface {
|
||||
* @param AuthServer $authServer AuthServer instance
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AuthServer $authServer)
|
||||
public function __construct(Authorization $authServer)
|
||||
{
|
||||
$this->authServer = $authServer;
|
||||
}
|
||||
|
@@ -9,15 +9,15 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Grant;
|
||||
namespace League\OAuth2\Server\Grant;
|
||||
|
||||
use League\OAuth2\Request;
|
||||
use League\OAuth2\AuthServer;
|
||||
use League\OAuth2\Exception;
|
||||
use League\OAuth2\Util\SecureKey;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Request;
|
||||
use League\OAuth2\Server\Authorization;
|
||||
use League\OAuth2\Server\Exception;
|
||||
use League\OAuth2\Server\Util\SecureKey;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
/**
|
||||
* Referesh token grant
|
||||
@@ -59,7 +59,7 @@ class RefreshToken implements GrantTypeInterface {
|
||||
* @param AuthServer $authServer AuthServer instance
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AuthServer $authServer)
|
||||
public function __construct(Authorization $authServer)
|
||||
{
|
||||
$this->authServer = $authServer;
|
||||
}
|
||||
|
@@ -9,17 +9,17 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2;
|
||||
namespace League\OAuth2\Server;
|
||||
|
||||
use OutOfBoundsException;
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Util\RequestInterface;
|
||||
use League\OAuth2\Util\Request;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Util\RequestInterface;
|
||||
use League\OAuth2\Server\Util\Request;
|
||||
|
||||
/**
|
||||
* OAuth 2.0 Resource Server
|
||||
*/
|
||||
class ResourceServer
|
||||
class Resource
|
||||
{
|
||||
/**
|
||||
* The access token
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Storage;
|
||||
namespace League\OAuth2\Server\Storage;
|
||||
|
||||
interface ClientInterface
|
||||
{
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace League\OAuth2\Storage\PDO;
|
||||
namespace League\OAuth2\Server\Storage\PDO;
|
||||
|
||||
use League\OAuth2\Storage\ClientInterface;
|
||||
use League\OAuth2\Server\Storage\ClientInterface;
|
||||
|
||||
class Client implements ClientInterface
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace League\OAuth2\Storage\PDO;
|
||||
namespace League\OAuth2\Server\Storage\PDO;
|
||||
|
||||
class Db
|
||||
{
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace League\OAuth2\Storage\PDO;
|
||||
namespace League\OAuth2\Server\Storage\PDO;
|
||||
|
||||
use League\OAuth2\Storage\ScopeInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
|
||||
class Scope implements ScopeInterface
|
||||
{
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace League\OAuth2\Storage\PDO;
|
||||
namespace League\OAuth2\Server\Storage\PDO;
|
||||
|
||||
use League\OAuth2\Storage\SessionInterface;
|
||||
use League\OAuth2\Server\Storage\SessionInterface;
|
||||
|
||||
class Session implements SessionInterface
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Storage;
|
||||
namespace League\OAuth2\Server\Storage;
|
||||
|
||||
interface ScopeInterface
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Storage;
|
||||
namespace League\OAuth2\Server\Storage;
|
||||
|
||||
interface SessionInterface
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Util;
|
||||
namespace League\OAuth2\Server\Util;
|
||||
|
||||
/**
|
||||
* RedirectUri class
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Util;
|
||||
namespace League\OAuth2\Server\Util;
|
||||
|
||||
use OutOfBoundsException;
|
||||
use InvalidMethodCallException;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Util;
|
||||
namespace League\OAuth2\Server\Util;
|
||||
|
||||
interface RequestInterface
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @link http://github.com/php-loep/oauth2-server
|
||||
*/
|
||||
|
||||
namespace League\OAuth2\Util;
|
||||
namespace League\OAuth2\Server\Util;
|
||||
|
||||
/**
|
||||
* SecureKey class
|
||||
|
Reference in New Issue
Block a user