chore: rename namespace to avoid conflict

This commit is contained in:
2024-03-09 23:23:39 +08:00
parent 64d36a111b
commit 32a73e155b
Signed by: LuoRain
GPG key ID: 16B4D3D5372966A6
29 changed files with 76 additions and 67 deletions

View file

@ -66,6 +66,15 @@
"FoskyM\\OAuthCenter\\Tests\\": "tests/"
}
},
"archive": {
"exclude": [
"vendor/",
"js/node_modules/",
"tests/",
"docs/",
".gitignore"
]
},
"scripts": {
"test": [
"@test:unit",

View file

@ -9,14 +9,14 @@
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter;
namespace RhodesIsland\OAuthCenter;
use Flarum\Extend;
use Flarum\Http\Middleware\AuthenticateWithHeader;
use Flarum\Http\Middleware\CheckCsrfToken;
use FoskyM\OAuthCenter\Middlewares\ResourceScopeMiddleware;
use FoskyM\OAuthCenter\Middlewares\UnsetCsrfMiddleware;
use FoskyM\OAuthCenter\Middlewares\UserCredentialsMiddleware;
use RhodesIsland\OAuthCenter\Middlewares\ResourceScopeMiddleware;
use RhodesIsland\OAuthCenter\Middlewares\UnsetCsrfMiddleware;
use RhodesIsland\OAuthCenter\Middlewares\UserCredentialsMiddleware;
return [
(new Extend\Frontend('forum'))

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractCreateController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Client;
use FoskyM\OAuthCenter\Api\Serializer\ClientSerializer;
use RhodesIsland\OAuthCenter\Models\Client;
use RhodesIsland\OAuthCenter\Api\Serializer\ClientSerializer;
class CreateClientController extends AbstractCreateController
{
@ -21,7 +21,7 @@ class CreateClientController extends AbstractCreateController
$attributes = Arr::get($request->getParsedBody(), 'data.attributes');
$validAttrs = [
'user_id' => $actor->id
'user_id' => $actor->id
];
collect(['client_id', 'client_secret', 'redirect_uri', 'grant_types', 'scope', 'client_name', 'client_desc', 'client_icon', 'client_home'])

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractCreateController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Scope;
use FoskyM\OAuthCenter\Api\Serializer\ScopeSerializer;
use RhodesIsland\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Api\Serializer\ScopeSerializer;
class CreateScopeController extends AbstractCreateController
{

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractDeleteController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Client;
use FoskyM\OAuthCenter\Api\Serializer\ClientSerializer;
use RhodesIsland\OAuthCenter\Models\Client;
use RhodesIsland\OAuthCenter\Api\Serializer\ClientSerializer;
class DeleteClientController extends AbstractDeleteController
{

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractDeleteController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Scope;
use FoskyM\OAuthCenter\Api\Serializer\ScopeSerializer;
use RhodesIsland\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Api\Serializer\ScopeSerializer;
class DeleteScopeController extends AbstractDeleteController
{

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractListController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Client;
use FoskyM\OAuthCenter\Api\Serializer\ClientSerializer;
use RhodesIsland\OAuthCenter\Models\Client;
use RhodesIsland\OAuthCenter\Api\Serializer\ClientSerializer;
class ListClientController extends AbstractListController
{

View file

@ -1,15 +1,15 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractListController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Scope;
use FoskyM\OAuthCenter\Api\Serializer\ScopeSerializer;
use FoskyM\OAuthCenter\Api\Serializer\ScopeUserSerializer;
use RhodesIsland\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Api\Serializer\ScopeSerializer;
use RhodesIsland\OAuthCenter\Api\Serializer\ScopeUserSerializer;
class ListScopeController extends AbstractListController
{

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractListController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Client;
use FoskyM\OAuthCenter\Api\Serializer\ClientPublicSerializer;
use RhodesIsland\OAuthCenter\Models\Client;
use RhodesIsland\OAuthCenter\Api\Serializer\ClientPublicSerializer;
class ShowClientController extends AbstractListController
{

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractListController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Client;
use FoskyM\OAuthCenter\Api\Serializer\ClientSerializer;
use RhodesIsland\OAuthCenter\Models\Client;
use RhodesIsland\OAuthCenter\Api\Serializer\ClientSerializer;
class UpdateClientController extends AbstractListController
{

View file

@ -1,14 +1,14 @@
<?php
namespace FoskyM\OAuthCenter\Api\Controller;
namespace RhodesIsland\OAuthCenter\Api\Controller;
use Flarum\Api\Controller\AbstractShowController;
use Flarum\Http\RequestUtil;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use FoskyM\OAuthCenter\Models\Scope;
use FoskyM\OAuthCenter\Api\Serializer\ScopeSerializer;
use RhodesIsland\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Api\Serializer\ScopeSerializer;
class UpdateScopeController extends AbstractShowController
{

View file

@ -1,9 +1,9 @@
<?php
namespace FoskyM\OAuthCenter\Api\Serializer;
namespace RhodesIsland\OAuthCenter\Api\Serializer;
use Flarum\Api\Serializer\AbstractSerializer;
use FoskyM\OAuthCenter\Models\Client;
use RhodesIsland\OAuthCenter\Models\Client;
use InvalidArgumentException;
class ClientPublicSerializer extends AbstractSerializer

View file

@ -1,9 +1,9 @@
<?php
namespace FoskyM\OAuthCenter\Api\Serializer;
namespace RhodesIsland\OAuthCenter\Api\Serializer;
use Flarum\Api\Serializer\AbstractSerializer;
use FoskyM\OAuthCenter\Models\Client;
use RhodesIsland\OAuthCenter\Models\Client;
use InvalidArgumentException;
class ClientSerializer extends AbstractSerializer

View file

@ -1,9 +1,9 @@
<?php
namespace FoskyM\OAuthCenter\Api\Serializer;
namespace RhodesIsland\OAuthCenter\Api\Serializer;
use Flarum\Api\Serializer\AbstractSerializer;
use FoskyM\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Models\Scope;
use InvalidArgumentException;
class ScopeSerializer extends AbstractSerializer

View file

@ -1,9 +1,9 @@
<?php
namespace FoskyM\OAuthCenter\Api\Serializer;
namespace RhodesIsland\OAuthCenter\Api\Serializer;
use Flarum\Api\Serializer\AbstractSerializer;
use FoskyM\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Models\Scope;
use InvalidArgumentException;
class ScopeUserSerializer extends AbstractSerializer

View file

@ -8,10 +8,10 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Controllers;
namespace RhodesIsland\OAuthCenter\Controllers;
use Flarum\User\User;
use Flarum\Http\RequestUtil;
use FoskyM\OAuthCenter\OAuth;
use RhodesIsland\OAuthCenter\OAuth;
use Illuminate\Support\Arr;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

View file

@ -8,10 +8,10 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Controllers;
namespace RhodesIsland\OAuthCenter\Controllers;
use Flarum\User\User;
use Flarum\Http\RequestUtil;
use FoskyM\OAuthCenter\OAuth;
use RhodesIsland\OAuthCenter\OAuth;
use Illuminate\Support\Arr;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

View file

@ -8,10 +8,10 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Controllers;
namespace RhodesIsland\OAuthCenter\Controllers;
use Flarum\User\User;
use Flarum\Http\RequestUtil;
use FoskyM\OAuthCenter\OAuth;
use RhodesIsland\OAuthCenter\OAuth;
use Illuminate\Support\Arr;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

View file

@ -1,13 +1,13 @@
<?php
namespace FoskyM\OAuthCenter\Middlewares;
namespace RhodesIsland\OAuthCenter\Middlewares;
use Flarum\Foundation\ErrorHandling\ExceptionHandler\IlluminateValidationExceptionHandler;
use Flarum\Foundation\ErrorHandling\JsonApiFormatter;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\User\User;
use FoskyM\OAuthCenter\OAuth;
use FoskyM\OAuthCenter\Storage;
use RhodesIsland\OAuthCenter\OAuth;
use RhodesIsland\OAuthCenter\Storage;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
@ -17,7 +17,7 @@ use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Flarum\Http\RequestUtil;
use FoskyM\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Models\Scope;
class ResourceScopeMiddleware implements MiddlewareInterface
{

View file

@ -1,11 +1,11 @@
<?php
namespace FoskyM\OAuthCenter\Middlewares;
namespace RhodesIsland\OAuthCenter\Middlewares;
use Flarum\Foundation\ErrorHandling\ExceptionHandler\IlluminateValidationExceptionHandler;
use Flarum\Foundation\ErrorHandling\JsonApiFormatter;
use FoskyM\OAuthCenter\OAuth;
use FoskyM\OAuthCenter\Storage;
use RhodesIsland\OAuthCenter\OAuth;
use RhodesIsland\OAuthCenter\Storage;
use Illuminate\Support\Arr;
use Illuminate\Validation\ValidationException;
use Psr\Http\Message\ResponseInterface as Response;
@ -17,7 +17,7 @@ use Flarum\Api\JsonApiResponse;
use Tobscure\JsonApi\Document;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
use FoskyM\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Models\Scope;
class UnsetCsrfMiddleware implements MiddlewareInterface
{
public function process(Request $request, RequestHandlerInterface $handler): Response

View file

@ -1,17 +1,17 @@
<?php
namespace FoskyM\OAuthCenter\Middlewares;
namespace RhodesIsland\OAuthCenter\Middlewares;
use Flarum\User\User;
use FoskyM\OAuthCenter\OAuth;
use FoskyM\OAuthCenter\Storage;
use RhodesIsland\OAuthCenter\OAuth;
use RhodesIsland\OAuthCenter\Storage;
use Illuminate\Support\Arr;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Laminas\Diactoros\Response\JsonResponse;
use FoskyM\OAuthCenter\Models\Scope;
use RhodesIsland\OAuthCenter\Models\Scope;
class UserCredentialsMiddleware implements MiddlewareInterface
{
public function process(Request $request, RequestHandlerInterface $handler): Response

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Models;
namespace RhodesIsland\OAuthCenter\Models;
use Flarum\Database\AbstractModel;

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Models;
namespace RhodesIsland\OAuthCenter\Models;
use Flarum\Database\AbstractModel;

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Models;
namespace RhodesIsland\OAuthCenter\Models;
use Flarum\Database\AbstractModel;

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Models;
namespace RhodesIsland\OAuthCenter\Models;
use Flarum\Database\AbstractModel;

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Models;
namespace RhodesIsland\OAuthCenter\Models;
use Flarum\Database\AbstractModel;

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter\Models;
namespace RhodesIsland\OAuthCenter\Models;
use Flarum\Database\AbstractModel;

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter;
namespace RhodesIsland\OAuthCenter;
use OAuth2\Server;
use OAuth2\Response;

View file

@ -8,7 +8,7 @@
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter;
namespace RhodesIsland\OAuthCenter;
use Flarum\Extend\Model;
use Flarum\User\User;
use OAuth2\OpenID\Storage\AuthorizationCodeInterface as OpenIDAuthorizationCodeInterface;