|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of the Spryker Commerce OS. |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
declare(strict_types = 1); |
|
9
|
|
|
|
|
10
|
|
|
namespace Pyz\Glue\GlueBackendApiApplication; |
|
11
|
|
|
|
|
12
|
|
|
use Spryker\Glue\DynamicEntityBackendApi\Plugin\GlueApplication\DynamicEntityRouteProviderPlugin; |
|
13
|
|
|
use Spryker\Glue\EventDispatcher\Plugin\GlueBackendApiApplication\EventDispatcherApplicationPlugin; |
|
14
|
|
|
use Spryker\Glue\GlueBackendApiApplication\GlueBackendApiApplicationDependencyProvider as SprykerGlueBackendApiApplicationDependencyProvider; |
|
15
|
|
|
use Spryker\Glue\GlueBackendApiApplication\Plugin\GlueApplication\ApplicationIdentifierRequestBuilderPlugin; |
|
16
|
|
|
use Spryker\Glue\GlueBackendApiApplication\Plugin\GlueApplication\LocaleRequestBuilderPlugin; |
|
17
|
|
|
use Spryker\Glue\GlueBackendApiApplication\Plugin\GlueApplication\RequestCorsValidatorPlugin; |
|
18
|
|
|
use Spryker\Glue\GlueBackendApiApplication\Plugin\GlueApplication\ScopeRequestAfterRoutingValidatorPlugin; |
|
19
|
|
|
use Spryker\Glue\GlueBackendApiApplication\Plugin\GlueApplication\SecurityHeaderResponseFormatterPlugin; |
|
20
|
|
|
use Spryker\Glue\GlueBackendApiApplication\Plugin\GlueApplication\StrictTransportSecurityHeaderResponseFormatterPlugin; |
|
21
|
|
|
use Spryker\Glue\GlueBackendApiApplicationAuthorizationConnector\Plugin\GlueBackendApiApplication\AuthorizationRequestAfterRoutingValidatorPlugin; |
|
22
|
|
|
use Spryker\Glue\Http\Plugin\Application\HttpApplicationPlugin; |
|
23
|
|
|
use Spryker\Glue\Locale\Plugin\Application\LocaleApplicationPlugin; |
|
24
|
|
|
use Spryker\Glue\MultiFactorAuth\Plugin\GlueBackendApiApplication\MultiFactorAuthBackendApiRequestValidatorPlugin; |
|
25
|
|
|
use Spryker\Glue\MultiFactorAuth\Plugin\GlueBackendApiApplication\MultiFactorAuthBackendResourcePlugin; |
|
26
|
|
|
use Spryker\Glue\MultiFactorAuth\Plugin\GlueBackendApiApplication\MultiFactorAuthTriggerBackendResourcePlugin; |
|
27
|
|
|
use Spryker\Glue\MultiFactorAuth\Plugin\GlueBackendApiApplication\MultiFactorAuthTypeActivateBackendResourcePlugin; |
|
28
|
|
|
use Spryker\Glue\MultiFactorAuth\Plugin\GlueBackendApiApplication\MultiFactorAuthTypeDeactivateBackendResourcePlugin; |
|
29
|
|
|
use Spryker\Glue\MultiFactorAuth\Plugin\GlueBackendApiApplication\MultiFactorAuthTypeVerifyBackendResourcePlugin; |
|
30
|
|
|
use Spryker\Glue\OauthBackendApi\Plugin\GlueApplication\BackendApiAccessTokenValidatorPlugin; |
|
31
|
|
|
use Spryker\Glue\OauthBackendApi\Plugin\GlueApplication\OauthBackendApiTokenResource; |
|
32
|
|
|
use Spryker\Glue\OauthBackendApi\Plugin\GlueApplication\UserRequestValidatorPlugin; |
|
33
|
|
|
use Spryker\Glue\OauthBackendApi\Plugin\UserRequestBuilderPlugin; |
|
34
|
|
|
use Spryker\Glue\Router\Plugin\Application\RouterApplicationPlugin; |
|
35
|
|
|
use Spryker\Glue\StoresApi\Plugin\GlueBackendApiApplication\StoreApplicationPlugin as ClientStoreApplicationPlugin; |
|
36
|
|
|
use Spryker\Glue\StoresBackendApi\Plugin\GlueBackendApiApplication\StoreApplicationPlugin; |
|
37
|
|
|
use Spryker\Glue\TestifyBackendApi\Plugin\GlueBackendApiApplication\DynamicFixturesBackendResourcePlugin; |
|
38
|
|
|
use Spryker\Zed\Propel\Communication\Plugin\Application\PropelApplicationPlugin; |
|
39
|
|
|
use Spryker\Zed\Twig\Communication\Plugin\Application\TwigApplicationPlugin; |
|
40
|
|
|
|
|
41
|
|
|
class GlueBackendApiApplicationDependencyProvider extends SprykerGlueBackendApiApplicationDependencyProvider |
|
42
|
|
|
{ |
|
43
|
|
|
/** |
|
44
|
|
|
* @return array<\Spryker\Shared\ApplicationExtension\Dependency\Plugin\ApplicationPluginInterface> |
|
45
|
|
|
*/ |
|
46
|
|
|
protected function getApplicationPlugins(): array |
|
47
|
|
|
{ |
|
48
|
|
|
return [ |
|
49
|
|
|
new HttpApplicationPlugin(), |
|
50
|
|
|
new PropelApplicationPlugin(), |
|
51
|
|
|
new ClientStoreApplicationPlugin(), |
|
52
|
|
|
new StoreApplicationPlugin(), |
|
53
|
|
|
new RouterApplicationPlugin(), |
|
54
|
|
|
new EventDispatcherApplicationPlugin(), |
|
55
|
|
|
new LocaleApplicationPlugin(), |
|
56
|
|
|
new TwigApplicationPlugin(), |
|
57
|
|
|
]; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestBuilderPluginInterface> |
|
62
|
|
|
*/ |
|
63
|
|
|
protected function getRequestBuilderPlugins(): array |
|
64
|
|
|
{ |
|
65
|
|
|
return [ |
|
66
|
|
|
new ApplicationIdentifierRequestBuilderPlugin(), |
|
67
|
|
|
new LocaleRequestBuilderPlugin(), |
|
68
|
|
|
new UserRequestBuilderPlugin(), |
|
|
|
|
|
|
69
|
|
|
]; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestValidatorPluginInterface> |
|
74
|
|
|
*/ |
|
75
|
|
|
protected function getRequestValidatorPlugins(): array |
|
76
|
|
|
{ |
|
77
|
|
|
return [ |
|
78
|
|
|
new BackendApiAccessTokenValidatorPlugin(), |
|
79
|
|
|
new UserRequestValidatorPlugin(), |
|
80
|
|
|
]; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestAfterRoutingValidatorPluginInterface> |
|
85
|
|
|
*/ |
|
86
|
|
|
protected function getRequestAfterRoutingValidatorPlugins(): array |
|
87
|
|
|
{ |
|
88
|
|
|
return [ |
|
89
|
|
|
new RequestCorsValidatorPlugin(), |
|
90
|
|
|
new ScopeRequestAfterRoutingValidatorPlugin(), |
|
91
|
|
|
new AuthorizationRequestAfterRoutingValidatorPlugin(), |
|
92
|
|
|
new MultiFactorAuthBackendApiRequestValidatorPlugin(), |
|
93
|
|
|
]; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResponseFormatterPluginInterface> |
|
98
|
|
|
*/ |
|
99
|
|
|
protected function getResponseFormatterPlugins(): array |
|
100
|
|
|
{ |
|
101
|
|
|
return [ |
|
102
|
|
|
new SecurityHeaderResponseFormatterPlugin(), |
|
103
|
|
|
new StrictTransportSecurityHeaderResponseFormatterPlugin(), |
|
104
|
|
|
]; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourceInterface> |
|
109
|
|
|
*/ |
|
110
|
|
|
protected function getResourcePlugins(): array |
|
111
|
|
|
{ |
|
112
|
|
|
$plugins = [ |
|
113
|
|
|
new OauthBackendApiTokenResource(), |
|
114
|
|
|
new MultiFactorAuthBackendResourcePlugin(), |
|
115
|
|
|
new MultiFactorAuthTriggerBackendResourcePlugin(), |
|
116
|
|
|
new MultiFactorAuthTypeActivateBackendResourcePlugin(), |
|
117
|
|
|
new MultiFactorAuthTypeDeactivateBackendResourcePlugin(), |
|
118
|
|
|
new MultiFactorAuthTypeVerifyBackendResourcePlugin(), |
|
119
|
|
|
]; |
|
120
|
|
|
|
|
121
|
|
|
if (class_exists(DynamicFixturesBackendResourcePlugin::class)) { |
|
122
|
|
|
$plugins[] = new DynamicFixturesBackendResourcePlugin(); |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
return $plugins; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RouteProviderPluginInterface> |
|
130
|
|
|
*/ |
|
131
|
|
|
protected function getRouteProviderPlugins(): array |
|
132
|
|
|
{ |
|
133
|
|
|
return [ |
|
134
|
|
|
new DynamicEntityRouteProviderPlugin(), |
|
135
|
|
|
]; |
|
136
|
|
|
} |
|
137
|
|
|
} |
|
138
|
|
|
|