Renamed AuthServer to Authorization, renamed ResourceServer to Resource. Updated all tests and other files

This commit is contained in:
Alex Bilbie
2013-05-08 11:42:23 -07:00
parent 1df524ae6e
commit 437833cd32
32 changed files with 273 additions and 273 deletions

View File

@@ -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

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Exception;
namespace League\OAuth2\Server\Exception;
/**
* ClientException Exception

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Exception;
namespace League\OAuth2\Server\Exception;
/**
* InvalidAccessToken Exception

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Exception;
namespace League\OAuth2\Server\Exception;
/**
* InvalidGrantTypeException Exception

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Exception;
namespace League\OAuth2\Server\Exception;
/**
* Exception class

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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())

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Storage;
namespace League\OAuth2\Server\Storage;
interface ClientInterface
{

View File

@@ -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
{

View File

@@ -1,6 +1,6 @@
<?php
namespace League\OAuth2\Storage\PDO;
namespace League\OAuth2\Server\Storage\PDO;
class Db
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Storage;
namespace League\OAuth2\Server\Storage;
interface ScopeInterface
{

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Storage;
namespace League\OAuth2\Server\Storage;
interface SessionInterface
{

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Util;
namespace League\OAuth2\Server\Util;
/**
* RedirectUri class

View File

@@ -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;

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Util;
namespace League\OAuth2\Server\Util;
interface RequestInterface
{

View File

@@ -9,7 +9,7 @@
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Util;
namespace League\OAuth2\Server\Util;
/**
* SecureKey class