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/" "FoskyM\\OAuthCenter\\Tests\\": "tests/"
} }
}, },
"archive": {
"exclude": [
"vendor/",
"js/node_modules/",
"tests/",
"docs/",
".gitignore"
]
},
"scripts": { "scripts": {
"test": [ "test": [
"@test:unit", "@test:unit",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,17 +1,17 @@
<?php <?php
namespace FoskyM\OAuthCenter\Middlewares; namespace RhodesIsland\OAuthCenter\Middlewares;
use Flarum\User\User; use Flarum\User\User;
use FoskyM\OAuthCenter\OAuth; use RhodesIsland\OAuthCenter\OAuth;
use FoskyM\OAuthCenter\Storage; use RhodesIsland\OAuthCenter\Storage;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface; use Psr\Http\Server\RequestHandlerInterface;
use Laminas\Diactoros\Response\JsonResponse; use Laminas\Diactoros\Response\JsonResponse;
use FoskyM\OAuthCenter\Models\Scope; use RhodesIsland\OAuthCenter\Models\Scope;
class UserCredentialsMiddleware implements MiddlewareInterface class UserCredentialsMiddleware implements MiddlewareInterface
{ {
public function process(Request $request, RequestHandlerInterface $handler): Response 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 * For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace FoskyM\OAuthCenter\Models; namespace RhodesIsland\OAuthCenter\Models;
use Flarum\Database\AbstractModel; use Flarum\Database\AbstractModel;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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