1 | <?php namespace Limoncello\Passport\Integration; |
||
40 | abstract class BasePassportServerIntegration implements PassportServerIntegrationInterface |
||
41 | { |
||
42 | /** Approval parameter */ |
||
43 | const SCOPE_APPROVAL_TYPE = 'type'; |
||
44 | |||
45 | /** Approval parameter */ |
||
46 | const SCOPE_APPROVAL_CLIENT_ID = 'client_id'; |
||
47 | |||
48 | /** Approval parameter */ |
||
49 | const SCOPE_APPROVAL_CLIENT_NAME = 'client_name'; |
||
50 | |||
51 | /** Approval parameter */ |
||
52 | const SCOPE_APPROVAL_REDIRECT_URI = 'redirect_uri'; |
||
53 | |||
54 | /** Approval parameter */ |
||
55 | const SCOPE_APPROVAL_IS_SCOPE_MODIFIED = 'is_scope_modified'; |
||
56 | |||
57 | /** Approval parameter */ |
||
58 | const SCOPE_APPROVAL_SCOPE = 'scope'; |
||
59 | |||
60 | /** Approval parameter */ |
||
61 | const SCOPE_APPROVAL_STATE = 'state'; |
||
62 | |||
63 | /** |
||
64 | * @var ContainerInterface |
||
65 | */ |
||
66 | private $container; |
||
67 | |||
68 | /** |
||
69 | * @var array |
||
70 | */ |
||
71 | private $settings; |
||
72 | |||
73 | /** |
||
74 | * @var string |
||
75 | */ |
||
76 | private $defaultClientId; |
||
77 | |||
78 | /** |
||
79 | * @var Connection |
||
80 | */ |
||
81 | private $connection; |
||
82 | |||
83 | /** |
||
84 | * @var DatabaseSchemaInterface |
||
85 | */ |
||
86 | private $databaseSchema; |
||
87 | |||
88 | /** |
||
89 | * @var string |
||
90 | */ |
||
91 | private $approvalUriString; |
||
92 | |||
93 | /** |
||
94 | * @var string |
||
95 | */ |
||
96 | private $errorUriString; |
||
97 | |||
98 | /** |
||
99 | * @var int |
||
100 | */ |
||
101 | private $codeExpiration; |
||
102 | |||
103 | /** |
||
104 | * @var int |
||
105 | */ |
||
106 | private $tokenExpiration; |
||
107 | /** |
||
108 | * @var bool |
||
109 | */ |
||
110 | private $isRenewRefreshValue; |
||
111 | |||
112 | /** |
||
113 | * @var callable|null |
||
114 | */ |
||
115 | private $customPropProvider; |
||
116 | |||
117 | /** |
||
118 | * @param ContainerInterface $container |
||
119 | */ |
||
120 | 23 | public function __construct(ContainerInterface $container) |
|
144 | |||
145 | /** |
||
146 | * @inheritdoc |
||
147 | */ |
||
148 | 7 | public function validateUserId(string $userName, string $password) |
|
155 | |||
156 | /** |
||
157 | * @inheritdoc |
||
158 | */ |
||
159 | 6 | public function verifyAllowedUserScope(int $userIdentity, array $scope = null): ?array |
|
166 | |||
167 | /** |
||
168 | * @inheritdoc |
||
169 | */ |
||
170 | 4 | public function getDefaultClientIdentifier(): string |
|
174 | |||
175 | /** |
||
176 | * @inheritdoc |
||
177 | * |
||
178 | * @throws Exception |
||
179 | */ |
||
180 | 1 | public function generateCodeValue(TokenInterface $token): string |
|
188 | |||
189 | /** |
||
190 | * @inheritdoc |
||
191 | * |
||
192 | * @throws Exception |
||
193 | */ |
||
194 | 6 | public function generateTokenValues(TokenInterface $token): array |
|
208 | |||
209 | /** |
||
210 | * @inheritdoc |
||
211 | */ |
||
212 | 1 | public function getCodeExpirationPeriod(): int |
|
216 | |||
217 | /** |
||
218 | * @inheritdoc |
||
219 | */ |
||
220 | 6 | public function getTokenExpirationPeriod(): int |
|
224 | |||
225 | /** |
||
226 | * @inheritdoc |
||
227 | */ |
||
228 | 2 | public function isRenewRefreshValue(): bool |
|
232 | |||
233 | /** |
||
234 | * @inheritdoc |
||
235 | */ |
||
236 | 5 | public function createInvalidClientAndRedirectUriErrorResponse(): ResponseInterface |
|
240 | |||
241 | /** @noinspection PhpTooManyParametersInspection |
||
242 | * @inheritdoc |
||
243 | * |
||
244 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
245 | */ |
||
246 | 5 | public function createAskResourceOwnerForApprovalResponse( |
|
274 | |||
275 | /** |
||
276 | * @inheritdoc |
||
277 | */ |
||
278 | 1 | public function verifyClientCredentials(ClientInterface $client, string $credentials): bool |
|
285 | |||
286 | /** |
||
287 | * @inheritdoc |
||
288 | */ |
||
289 | 5 | public function getBodyTokenExtraParameters(TokenInterface $token): array |
|
293 | |||
294 | /** |
||
295 | * @param string $uri |
||
296 | * @param array $data |
||
297 | * |
||
298 | * @return UriInterface |
||
299 | */ |
||
300 | 5 | protected function createRedirectUri(string $uri, array $data): UriInterface |
|
307 | |||
308 | /** |
||
309 | * @return ContainerInterface |
||
310 | */ |
||
311 | 7 | protected function getContainer(): ContainerInterface |
|
315 | |||
316 | /** |
||
317 | * @return Connection |
||
318 | */ |
||
319 | 19 | protected function getConnection(): Connection |
|
323 | |||
324 | /** |
||
325 | * @return DatabaseSchemaInterface |
||
326 | */ |
||
327 | 19 | protected function getDatabaseSchema(): DatabaseSchemaInterface |
|
335 | |||
336 | /** |
||
337 | * @return string |
||
338 | */ |
||
339 | 5 | protected function getApprovalUriString(): string |
|
343 | |||
344 | /** |
||
345 | * @return string |
||
346 | */ |
||
347 | 5 | protected function getErrorUriString(): string |
|
351 | } |
||
352 |