1 | <?php declare(strict_types=1); |
||
52 | abstract class BasePassportServerIntegration implements PassportServerIntegrationInterface |
||
53 | { |
||
54 | /** Approval parameter */ |
||
55 | const SCOPE_APPROVAL_TYPE = 'type'; |
||
56 | |||
57 | /** Approval parameter */ |
||
58 | const SCOPE_APPROVAL_CLIENT_ID = 'client_id'; |
||
59 | |||
60 | /** Approval parameter */ |
||
61 | const SCOPE_APPROVAL_CLIENT_NAME = 'client_name'; |
||
62 | |||
63 | /** Approval parameter */ |
||
64 | const SCOPE_APPROVAL_REDIRECT_URI = 'redirect_uri'; |
||
65 | |||
66 | /** Approval parameter */ |
||
67 | const SCOPE_APPROVAL_IS_SCOPE_MODIFIED = 'is_scope_modified'; |
||
68 | |||
69 | /** Approval parameter */ |
||
70 | const SCOPE_APPROVAL_SCOPE = 'scope'; |
||
71 | |||
72 | /** Approval parameter */ |
||
73 | const SCOPE_APPROVAL_STATE = 'state'; |
||
74 | |||
75 | /** |
||
76 | * @var ContainerInterface |
||
77 | */ |
||
78 | private $container; |
||
79 | |||
80 | /** |
||
81 | * @var array |
||
82 | */ |
||
83 | private $settings; |
||
84 | |||
85 | /** |
||
86 | * @var string |
||
87 | */ |
||
88 | private $defaultClientId; |
||
89 | |||
90 | /** |
||
91 | * @var Connection |
||
92 | */ |
||
93 | private $connection; |
||
94 | |||
95 | /** |
||
96 | * @var DatabaseSchemaInterface |
||
97 | */ |
||
98 | private $databaseSchema; |
||
99 | |||
100 | /** |
||
101 | * @var string |
||
102 | */ |
||
103 | private $approvalUriString; |
||
104 | |||
105 | /** |
||
106 | * @var string |
||
107 | */ |
||
108 | private $errorUriString; |
||
109 | |||
110 | /** |
||
111 | * @var int |
||
112 | */ |
||
113 | private $codeExpiration; |
||
114 | |||
115 | /** |
||
116 | * @var int |
||
117 | */ |
||
118 | private $tokenExpiration; |
||
119 | /** |
||
120 | * @var bool |
||
121 | */ |
||
122 | private $isRenewRefreshValue; |
||
123 | |||
124 | /** |
||
125 | * @var callable|null |
||
126 | */ |
||
127 | private $customPropProvider; |
||
128 | |||
129 | /** |
||
130 | * @param ContainerInterface $container |
||
131 | */ |
||
132 | 23 | public function __construct(ContainerInterface $container) |
|
156 | |||
157 | /** |
||
158 | * @inheritdoc |
||
159 | */ |
||
160 | 7 | public function validateUserId(string $userName, string $password) |
|
167 | |||
168 | /** |
||
169 | * @inheritdoc |
||
170 | */ |
||
171 | 6 | public function verifyAllowedUserScope(int $userIdentity, array $scope = null): ?array |
|
178 | |||
179 | /** |
||
180 | * @inheritdoc |
||
181 | */ |
||
182 | 4 | public function getDefaultClientIdentifier(): string |
|
186 | |||
187 | /** |
||
188 | * @inheritdoc |
||
189 | * |
||
190 | * @throws Exception |
||
191 | */ |
||
192 | 1 | public function generateCodeValue(TokenInterface $token): string |
|
200 | |||
201 | /** |
||
202 | * @inheritdoc |
||
203 | * |
||
204 | * @throws Exception |
||
205 | */ |
||
206 | 6 | public function generateTokenValues(TokenInterface $token): array |
|
220 | |||
221 | /** |
||
222 | * @inheritdoc |
||
223 | */ |
||
224 | 1 | public function getCodeExpirationPeriod(): int |
|
228 | |||
229 | /** |
||
230 | * @inheritdoc |
||
231 | */ |
||
232 | 6 | public function getTokenExpirationPeriod(): int |
|
236 | |||
237 | /** |
||
238 | * @inheritdoc |
||
239 | */ |
||
240 | 2 | public function isRenewRefreshValue(): bool |
|
244 | |||
245 | /** |
||
246 | * @inheritdoc |
||
247 | */ |
||
248 | 5 | public function createInvalidClientAndRedirectUriErrorResponse(): ResponseInterface |
|
252 | |||
253 | /** @noinspection PhpTooManyParametersInspection |
||
254 | * @inheritdoc |
||
255 | * |
||
256 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
257 | */ |
||
258 | 5 | public function createAskResourceOwnerForApprovalResponse( |
|
286 | |||
287 | /** |
||
288 | * @inheritdoc |
||
289 | */ |
||
290 | 1 | public function verifyClientCredentials(ClientInterface $client, string $credentials): bool |
|
297 | |||
298 | /** |
||
299 | * @inheritdoc |
||
300 | */ |
||
301 | 5 | public function getBodyTokenExtraParameters(TokenInterface $token): array |
|
305 | |||
306 | /** |
||
307 | * @param string $uri |
||
308 | * @param array $data |
||
309 | * |
||
310 | * @return UriInterface |
||
311 | */ |
||
312 | 5 | protected function createRedirectUri(string $uri, array $data): UriInterface |
|
319 | |||
320 | /** |
||
321 | * @return ContainerInterface |
||
322 | */ |
||
323 | 7 | protected function getContainer(): ContainerInterface |
|
327 | |||
328 | /** |
||
329 | * @return Connection |
||
330 | */ |
||
331 | 19 | protected function getConnection(): Connection |
|
335 | |||
336 | /** |
||
337 | * @return DatabaseSchemaInterface |
||
338 | */ |
||
339 | 19 | protected function getDatabaseSchema(): DatabaseSchemaInterface |
|
347 | |||
348 | /** |
||
349 | * @return string |
||
350 | */ |
||
351 | 5 | protected function getApprovalUriString(): string |
|
355 | |||
356 | /** |
||
357 | * @return string |
||
358 | */ |
||
359 | 5 | protected function getErrorUriString(): string |
|
363 | } |
||
364 |