|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
5 | 5 | use Api\App\Factory\ErrorResponseGeneratorFactory; |
6 | | -use Api\App\Factory\OAuthAccessTokenRepositoryFactory; |
7 | | -use Api\App\Factory\OAuthAuthCodeRepositoryFactory; |
8 | | -use Api\App\Factory\OAuthClientRepositoryFactory; |
9 | | -use Api\App\Factory\OAuthRefreshTokenRepositoryFactory; |
10 | | -use Api\App\Factory\OAuthScopeRepositoryFactory; |
11 | 6 | use Api\App\Factory\UserIdentityFactory; |
12 | | -use Api\App\Factory\UserRepositoryFactory; |
13 | | -use Core\App\Repository\OAuthAccessTokenRepository; |
14 | | -use Core\App\Repository\OAuthAuthCodeRepository; |
15 | | -use Core\App\Repository\OAuthClientRepository; |
16 | | -use Core\App\Repository\OAuthRefreshTokenRepository; |
17 | | -use Core\App\Repository\OAuthScopeRepository; |
| 7 | +use Core\Security\Repository\OAuthAccessTokenRepository; |
| 8 | +use Core\Security\Repository\OAuthAuthCodeRepository; |
| 9 | +use Core\Security\Repository\OAuthClientRepository; |
| 10 | +use Core\Security\Repository\OAuthRefreshTokenRepository; |
| 11 | +use Core\Security\Repository\OAuthScopeRepository; |
18 | 12 | use Core\User\Repository\UserRepository; |
19 | 13 | use Core\User\UserIdentity; |
20 | 14 | use Doctrine\Migrations\Tools\Console\Command\ExecuteCommand; |
21 | | -use Dot\ErrorHandler\ErrorHandlerInterface; |
22 | | -use Dot\ErrorHandler\LogErrorHandler; |
23 | 15 | use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface; |
24 | 16 | use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface; |
25 | 17 | use League\OAuth2\Server\Repositories\ClientRepositoryInterface; |
26 | 18 | use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface; |
27 | 19 | use League\OAuth2\Server\Repositories\ScopeRepositoryInterface; |
28 | 20 | use League\OAuth2\Server\Repositories\UserRepositoryInterface; |
| 21 | +use Mezzio\Authentication\UserInterface; |
| 22 | +use Mezzio\Authorization\AuthorizationInterface; |
| 23 | +use Mezzio\Authorization\Rbac\LaminasRbac; |
| 24 | +use Mezzio\Middleware\ErrorResponseGenerator; |
29 | 25 | use Roave\PsrContainerDoctrine\Migrations\CommandFactory; |
30 | 26 |
|
31 | 27 | return [ |
32 | 28 | // Provides application-wide services. |
33 | | - // We recommend using fully-qualified class names whenever possible as |
34 | | - // service names. |
| 29 | + // We recommend using fully-qualified class names whenever possible as service names. |
35 | 30 | 'dependencies' => [ |
36 | | - // Use 'aliases' to alias a service name to another service. The |
37 | | - // key is the alias name, the value is the service to which it points. |
| 31 | + // Use 'aliases' to alias a service name to another service. |
| 32 | + // The key is the alias name, the value is the service to which it points. |
38 | 33 | 'aliases' => [ |
39 | | - AccessTokenRepositoryInterface::class => OAuthAccessTokenRepository::class, |
40 | | - AuthCodeRepositoryInterface::class => OAuthAuthCodeRepository::class, |
41 | | - ClientRepositoryInterface::class => OAuthClientRepository::class, |
42 | | - RefreshTokenRepositoryInterface::class => OAuthRefreshTokenRepository::class, |
43 | | - ScopeRepositoryInterface::class => OAuthScopeRepository::class, |
44 | | - Mezzio\Authentication\UserInterface::class => UserIdentity::class, |
45 | | - ErrorHandlerInterface::class => LogErrorHandler::class, |
46 | | - Mezzio\Authorization\AuthorizationInterface::class => Mezzio\Authorization\Rbac\LaminasRbac::class, |
47 | | - UserRepositoryInterface::class => UserRepository::class, |
| 34 | + AccessTokenRepositoryInterface::class => OAuthAccessTokenRepository::class, |
| 35 | + AuthCodeRepositoryInterface::class => OAuthAuthCodeRepository::class, |
| 36 | + ClientRepositoryInterface::class => OAuthClientRepository::class, |
| 37 | + UserInterface::class => UserIdentity::class, |
| 38 | + AuthorizationInterface::class => LaminasRbac::class, |
| 39 | + RefreshTokenRepositoryInterface::class => OAuthRefreshTokenRepository::class, |
| 40 | + ScopeRepositoryInterface::class => OAuthScopeRepository::class, |
| 41 | + UserRepositoryInterface::class => UserRepository::class, |
48 | 42 | ], |
49 | | - // Use 'invokables' for constructor-less services, or services that do |
50 | | - // not require arguments to the constructor. Map a service name to the |
51 | | - // class name. |
| 43 | + // Use 'invokables' for constructor-less services, or services that do not require arguments to the constructor. |
| 44 | + // Map a service name to the class name. |
52 | 45 | 'invokables' => [ |
53 | 46 | // Fully\Qualified\InterfaceName::class => Fully\Qualified\ClassName::class, |
54 | 47 | ], |
55 | 48 | // Use 'factories' for services provided by callbacks/factory classes. |
56 | 49 | 'factories' => [ |
57 | | - ExecuteCommand::class => CommandFactory::class, |
58 | | - Mezzio\Middleware\ErrorResponseGenerator::class => ErrorResponseGeneratorFactory::class, |
59 | | - OAuthAccessTokenRepository::class => OAuthAccessTokenRepositoryFactory::class, |
60 | | - OAuthAuthCodeRepository::class => OAuthAuthCodeRepositoryFactory::class, |
61 | | - OAuthClientRepository::class => OAuthClientRepositoryFactory::class, |
62 | | - OAuthRefreshTokenRepository::class => OAuthRefreshTokenRepositoryFactory::class, |
63 | | - OAuthScopeRepository::class => OAuthScopeRepositoryFactory::class, |
64 | | - UserRepository::class => UserRepositoryFactory::class, |
65 | | - UserIdentity::class => UserIdentityFactory::class, |
| 50 | + ExecuteCommand::class => CommandFactory::class, |
| 51 | + ErrorResponseGenerator::class => ErrorResponseGeneratorFactory::class, |
| 52 | + UserIdentity::class => UserIdentityFactory::class, |
66 | 53 | ], |
67 | 54 | ], |
68 | 55 | ]; |
0 commit comments