Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0 #781

Open
wants to merge 21 commits into
base: 1.0
Choose a base branch
from
Open

1.0 #781

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lucadegasperi/oauth2-server-laravel",
"name": "tikamsah/oauth2-server-laravel",
"description": "A Laravel 4 wrapper for the popular OAuth 2.0 Server package league/oauth2-server",
"keywords": [
"laravel",
Expand All @@ -11,11 +11,11 @@
"authors": [
{
"name": "Luca Degasperi",
"email": "packages@lucadegasperi.com"
"email": "packages@tikamsah.com"
}
],
"require": {
"php": ">=5.3.0",
"php": ">=8.1",
"league/oauth2-server": "2.1.x"
},
"require-dev": {
Expand All @@ -30,9 +30,9 @@
"tests/TestCase.php"
],
"psr-0": {
"LucaDegasperi\\OAuth2Server": "src/"
"Tikamsah\\OAuth2Server": "src/"
}
},
"minimum-stability": "dev",
"license": "MIT"
}
}
8 changes: 4 additions & 4 deletions provides.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"providers": [
"LucaDegasperi\\OAuth2Server\\OAuth2ServerServiceProvider"
"Tikamsah\\OAuth2Server\\OAuth2ServerServiceProvider"
],
"aliases": [
{
"alias": "AuthorizationServer",
"facade": "LucaDegasperi\\OAuth2Server\\Facades\\AuthorizationServerFacade"
"facade": "Tikamsah\\OAuth2Server\\Facades\\AuthorizationServerFacade"
},
{
"alias": "ResourceServer",
"facade": "LucaDegasperi\\OAuth2Server\\Facades\\ResourceServerFacade"
"facade": "Tikamsah\\OAuth2Server\\Facades\\ResourceServerFacade"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php namespace LucaDegasperi\OAuth2Server\Commands;
<?php namespace Tikamsah\OAuth2Server\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use LucaDegasperi\OAuth2Server\Repositories\SessionManagementInterface;
use Tikamsah\OAuth2Server\Repositories\SessionManagementInterface;

class ExpiredTokensCommand extends Command
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Facades;
<?php namespace Tikamsah\OAuth2Server\Facades;

use Illuminate\Support\Facades\Facade;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Facades;
<?php namespace Tikamsah\OAuth2Server\Facades;

use Illuminate\Support\Facades\Facade;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Filters;
<?php namespace Tikamsah\OAuth2Server\Filters;

use AuthorizationServer;
use Response;
Expand Down
4 changes: 2 additions & 2 deletions src/LucaDegasperi/OAuth2Server/Filters/OAuthFilter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Filters;
<?php namespace Tikamsah\OAuth2Server\Filters;

use ResourceServer;
use Response;
Expand All @@ -18,7 +18,7 @@ class OAuthFilter
public function filter()
{
try {
ResourceServer::isValid(Config::get('lucadegasperi/oauth2-server-laravel::oauth2.http_headers_only'));
ResourceServer::isValid(Config::get('tikamsah/oauth2-server-laravel::oauth2.http_headers_only'));
} catch (\League\OAuth2\Server\Exception\InvalidAccessTokenException $e) {
return Response::json(array(
'status' => 401,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Filters;
<?php namespace Tikamsah\OAuth2Server\Filters;

use ResourceServer;
use Response;
Expand Down
24 changes: 12 additions & 12 deletions src/LucaDegasperi/OAuth2Server/OAuth2ServerServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace LucaDegasperi\OAuth2Server;
<?php namespace Tikamsah\OAuth2Server;

use Illuminate\Support\ServiceProvider;
use LucaDegasperi\OAuth2Server\Proxies\AuthorizationServerProxy;
use Tikamsah\OAuth2Server\Proxies\AuthorizationServerProxy;

class OAuth2ServerServiceProvider extends ServiceProvider
{
Expand All @@ -20,19 +20,19 @@ class OAuth2ServerServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->package('lucadegasperi/oauth2-server-laravel', 'lucadegasperi/oauth2-server-laravel');
$this->package('tikamsah/oauth2-server-laravel', 'tikamsah/oauth2-server-laravel');

/** @var \Illuminate\Routing\Router $router */
$router = $this->app['router'];

// Bind a filter to check if the auth code grant type params are provided
$router->filter('check-authorization-params', 'LucaDegasperi\OAuth2Server\Filters\CheckAuthorizationParamsFilter');
$router->filter('check-authorization-params', 'Tikamsah\OAuth2Server\Filters\CheckAuthorizationParamsFilter');

// Bind a filter to make sure that an endpoint is accessible only by authorized members eventually with specific scopes
$router->filter('oauth', 'LucaDegasperi\OAuth2Server\Filters\OAuthFilter');
$router->filter('oauth', 'Tikamsah\OAuth2Server\Filters\OAuthFilter');

// Bind a filter to make sure that an endpoint is accessible only by a specific owner
$router->filter('oauth-owner', 'LucaDegasperi\OAuth2Server\Filters\OAuthOwnerFilter');
$router->filter('oauth-owner', 'Tikamsah\OAuth2Server\Filters\OAuthOwnerFilter');
}

/**
Expand All @@ -45,16 +45,16 @@ public function register()
// let's bind the interfaces to the implementations
$app = $this->app;

$app->bind('League\OAuth2\Server\Storage\ClientInterface', 'LucaDegasperi\OAuth2Server\Repositories\FluentClient');
$app->bind('League\OAuth2\Server\Storage\ScopeInterface', 'LucaDegasperi\OAuth2Server\Repositories\FluentScope');
$app->bind('League\OAuth2\Server\Storage\SessionInterface', 'LucaDegasperi\OAuth2Server\Repositories\FluentSession');
$app->bind('LucaDegasperi\OAuth2Server\Repositories\SessionManagementInterface', 'LucaDegasperi\OAuth2Server\Repositories\FluentSession');
$app->bind('League\OAuth2\Server\Storage\ClientInterface', 'Tikamsah\OAuth2Server\Repositories\FluentClient');
$app->bind('League\OAuth2\Server\Storage\ScopeInterface', 'Tikamsah\OAuth2Server\Repositories\FluentScope');
$app->bind('League\OAuth2\Server\Storage\SessionInterface', 'Tikamsah\OAuth2Server\Repositories\FluentSession');
$app->bind('Tikamsah\OAuth2Server\Repositories\SessionManagementInterface', 'Tikamsah\OAuth2Server\Repositories\FluentSession');

$app['oauth2.authorization-server'] = $app->share(function ($app) {

$server = $app->make('League\OAuth2\Server\Authorization');

$config = $app['config']->get('lucadegasperi/oauth2-server-laravel::oauth2');
$config = $app['config']->get('tikamsah/oauth2-server-laravel::oauth2');

// add the supported grant types to the authorization server
foreach ($config['grant_types'] as $grantKey => $grantValue) {
Expand Down Expand Up @@ -99,7 +99,7 @@ public function register()
});

$app['oauth2.expired-tokens-command'] = $app->share(function ($app) {
return $app->make('LucaDegasperi\OAuth2Server\Commands\ExpiredTokensCommand');
return $app->make('Tikamsah\OAuth2Server\Commands\ExpiredTokensCommand');
});

$this->commands('oauth2.expired-tokens-command');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Proxies;
<?php namespace Tikamsah\OAuth2Server\Proxies;

use League\OAuth2\Server\Authorization as Authorization;
use League\OAuth2\Server\Util\RedirectUri;
Expand Down
4 changes: 2 additions & 2 deletions src/LucaDegasperi/OAuth2Server/Repositories/FluentClient.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Repositories;
<?php namespace Tikamsah\OAuth2Server\Repositories;

use League\OAuth2\Server\Storage\ClientInterface;
use DB;
Expand Down Expand Up @@ -81,7 +81,7 @@ public function getClient($clientId, $clientSecret = null, $redirectUri = null,
->where('oauth_client_endpoints.redirect_uri', $redirectUri);
}

if (Config::get('lucadegasperi/oauth2-server-laravel::oauth2.limit_clients_to_grants') === true and ! is_null($grantType)) {
if (Config::get('tikamsah/oauth2-server-laravel::oauth2.limit_clients_to_grants') === true and ! is_null($grantType)) {
$query = $query->join('oauth_client_grants', 'oauth_clients.id', '=', 'oauth_client_grants.client_id')
->join('oauth_grants', 'oauth_grants.id', '=', 'oauth_client_grants.grant_id')
->where('oauth_grants.grant', $grantType);
Expand Down
6 changes: 3 additions & 3 deletions src/LucaDegasperi/OAuth2Server/Repositories/FluentScope.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Repositories;
<?php namespace Tikamsah\OAuth2Server\Repositories;

use League\OAuth2\Server\Storage\ScopeInterface;
use DB;
Expand Down Expand Up @@ -39,12 +39,12 @@ public function getScope($scope, $clientId = null, $grantType = null)
->select('oauth_scopes.id as id', 'oauth_scopes.scope as scope', 'oauth_scopes.name as name', 'oauth_scopes.description as description')
->where('oauth_scopes.scope', $scope);

if (Config::get('lucadegasperi/oauth2-server-laravel::oauth2.limit_clients_to_scopes') === true and ! is_null($clientId)) {
if (Config::get('tikamsah/oauth2-server-laravel::oauth2.limit_clients_to_scopes') === true and ! is_null($clientId)) {
$query = $query->join('oauth_client_scopes', 'oauth_scopes.id', '=', 'oauth_client_scopes.scope_id')
->where('oauth_client_scopes.client_id', $clientId);
}

if (Config::get('lucadegasperi/oauth2-server-laravel::oauth2.limit_scopes_to_grants') === true and ! is_null($grantType)) {
if (Config::get('tikamsah/oauth2-server-laravel::oauth2.limit_scopes_to_grants') === true and ! is_null($grantType)) {
$query = $query->join('oauth_grant_scopes', 'oauth_scopes.id', '=', 'oauth_grant_scopes.scope_id')
->join('oauth_grants', 'oauth_grants.id', '=', 'oauth_grant_scopes.grant_id')
->where('oauth_grants.grant', $grantType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Repositories;
<?php namespace Tikamsah\OAuth2Server\Repositories;

use League\OAuth2\Server\Storage\SessionInterface;
use DB;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace LucaDegasperi\OAuth2Server\Repositories;
<?php namespace Tikamsah\OAuth2Server\Repositories;

interface SessionManagementInterface
{
Expand Down
2 changes: 1 addition & 1 deletion tests/AuthorizationServerProxyTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use \Mockery as m;
use LucaDegasperi\OAuth2Server\Proxies\AuthorizationServerProxy;
use Tikamsah\OAuth2Server\Proxies\AuthorizationServerProxy;

class AuthorizationServerProxyTest extends TestCase {

Expand Down
4 changes: 2 additions & 2 deletions tests/CheckAuthorizationParamsFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CheckAuthorizationParamsFilterTest extends TestCase {

public function getFilter()
{
return new LucaDegasperi\OAuth2Server\Filters\CheckAuthorizationParamsFilter;
return new Tikamsah\OAuth2Server\Filters\CheckAuthorizationParamsFilter;
}

public function getStub()
Expand Down Expand Up @@ -66,4 +66,4 @@ public function tearDown() {
m::close();
}

}
}
4 changes: 2 additions & 2 deletions tests/ExpiredTokensCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

use \Mockery as m;
use LucaDegasperi\OAuth2Server\Commands\ExpiredTokensCommand;
use Tikamsah\OAuth2Server\Commands\ExpiredTokensCommand;
use Symfony\Component\Console\Tester\CommandTester;

class ExpiredTokensCommandTest extends TestCase
{
public function getSession()
{
return m::mock('LucaDegasperi\OAuth2Server\Repositories\SessionManagementInterface');
return m::mock('Tikamsah\OAuth2Server\Repositories\SessionManagementInterface');
}

public function getCommand($session)
Expand Down
4 changes: 2 additions & 2 deletions tests/OAuthFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class OAuthFilterTest extends TestCase {

public function getFilter()
{
return new LucaDegasperi\OAuth2Server\Filters\OAuthFilter;
return new Tikamsah\OAuth2Server\Filters\OAuthFilter;
}

public function test_valid_filter_with_no_scope()
Expand Down Expand Up @@ -53,4 +53,4 @@ public function tearDown() {
m::close();
}

}
}
4 changes: 2 additions & 2 deletions tests/OAuthOwnerFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class OAuthOwnerFilterTest extends TestCase {

public function getFilter()
{
return new LucaDegasperi\OAuth2Server\Filters\OAuthOwnerFilter;
return new Tikamsah\OAuth2Server\Filters\OAuthOwnerFilter;
}

public function test_with_existing_owner_type()
Expand All @@ -30,4 +30,4 @@ public function tearDown() {
m::close();
}

}
}
8 changes: 4 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ class TestCase extends Orchestra\Testbench\TestCase {

protected function getPackageProviders()
{
return array('LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider');
return array('Tikamsah\OAuth2Server\OAuth2ServerServiceProvider');
}

protected function getPackageAliases()
{
return array(
'AuthorizationServer' => 'LucaDegasperi\OAuth2Server\Facades\AuthorizationServerFacade',
'ResourceServer' => 'LucaDegasperi\OAuth2Server\Facades\ResourceServerFacade',
'AuthorizationServer' => 'Tikamsah\OAuth2Server\Facades\AuthorizationServerFacade',
'ResourceServer' => 'Tikamsah\OAuth2Server\Facades\ResourceServerFacade',
);
}

}
}