@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | /** |
55 | 55 | * {@inheritdoc} |
56 | 56 | */ |
57 | - public function create(?UserAccountId $userAccountId, ?\DateTimeImmutable $expiresAt): InitialAccessToken |
|
57 | + public function create(? UserAccountId $userAccountId, ? \DateTimeImmutable $expiresAt) : InitialAccessToken |
|
58 | 58 | { |
59 | 59 | $initialAccessTokeId = InitialAccessTokenId::create(Uuid::uuid4()->toString()); |
60 | 60 | $initialAccessToken = InitialAccessToken::createEmpty(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * {@inheritdoc} |
68 | 68 | */ |
69 | - public function find(InitialAccessTokenId $initialAccessTokenId): ?InitialAccessToken |
|
69 | + public function find(InitialAccessTokenId $initialAccessTokenId): ? InitialAccessToken |
|
70 | 70 | { |
71 | 71 | $initialAccessToken = $this->getFromCache($initialAccessTokenId); |
72 | 72 | if (null === $initialAccessToken) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @return InitialAccessToken|null |
113 | 113 | */ |
114 | - private function getFromCache(InitialAccessTokenId $initialAccessTokenId): ?InitialAccessToken |
|
114 | + private function getFromCache(InitialAccessTokenId $initialAccessTokenId): ? InitialAccessToken |
|
115 | 115 | { |
116 | 116 | $itemKey = sprintf('oauth2-initial_access_token-%s', $initialAccessTokenId->getValue()); |
117 | 117 | if (null !== $this->cache) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * {@inheritdoc} |
58 | 58 | */ |
59 | - public function create(UserAccountId $userAccountId, ClientId $clientId, array $scopes, ?ResourceServerId $resourceServerId): PreConfiguredAuthorization |
|
59 | + public function create(UserAccountId $userAccountId, ClientId $clientId, array $scopes, ? ResourceServerId $resourceServerId) : PreConfiguredAuthorization |
|
60 | 60 | { |
61 | 61 | $hash = $this->calculateHash($userAccountId, $clientId, $scopes, $resourceServerId); |
62 | 62 | $preConfiguredAuthorization = PreConfiguredAuthorization::createEmpty(); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * {@inheritdoc} |
70 | 70 | */ |
71 | - public function find(UserAccountId $userAccountId, ClientId $clientId, array $scopes, ?ResourceServerId $resourceServerId): ?PreConfiguredAuthorization |
|
71 | + public function find(UserAccountId $userAccountId, ClientId $clientId, array $scopes, ? ResourceServerId $resourceServerId) : ? PreConfiguredAuthorization |
|
72 | 72 | { |
73 | 73 | $hash = $this->calculateHash($userAccountId, $clientId, $scopes, $resourceServerId); |
74 | 74 | $preConfiguredAuthorization = $this->getFromCache($hash); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @return PreConfiguredAuthorization|null |
116 | 116 | */ |
117 | - private function getFromCache(PreConfiguredAuthorizationId $preConfiguredAuthorizationId): ?PreConfiguredAuthorization |
|
117 | + private function getFromCache(PreConfiguredAuthorizationId $preConfiguredAuthorizationId): ? PreConfiguredAuthorization |
|
118 | 118 | { |
119 | 119 | $itemKey = sprintf('oauth2-pre_configured_authorization-%s', $preConfiguredAuthorizationId->getValue()); |
120 | 120 | if (null !== $this->cache) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * |
150 | 150 | * @return PreConfiguredAuthorizationId |
151 | 151 | */ |
152 | - private function calculateHash(ResourceOwnerId $resourceOwnerId, ClientId $clientId, array $scope, ?ResourceServerId $resourceServerId): PreConfiguredAuthorizationId |
|
152 | + private function calculateHash(ResourceOwnerId $resourceOwnerId, ClientId $clientId, array $scope, ? ResourceServerId $resourceServerId) : PreConfiguredAuthorizationId |
|
153 | 153 | { |
154 | 154 | return PreConfiguredAuthorizationId::create(hash( |
155 | 155 | 'sha512', |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * {@inheritdoc} |
80 | 80 | */ |
81 | - public function create(ClientId $clientId, UserAccountId $userAccountId, array $queryParameters, string $redirectUri, DataBag $parameters, DataBag $metadatas, array $scopes, bool $withRefreshToken, ?ResourceServerId $resourceServerId, ?\DateTimeImmutable $expiresAt): AuthCode |
|
81 | + public function create(ClientId $clientId, UserAccountId $userAccountId, array $queryParameters, string $redirectUri, DataBag $parameters, DataBag $metadatas, array $scopes, bool $withRefreshToken, ? ResourceServerId $resourceServerId, ? \DateTimeImmutable $expiresAt) : AuthCode |
|
82 | 82 | { |
83 | 83 | if (null === $expiresAt) { |
84 | 84 | $expiresAt = new \DateTimeImmutable(sprintf('now +%u seconds', $this->lifetime)); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | /** |
106 | 106 | * {@inheritdoc} |
107 | 107 | */ |
108 | - public function find(AuthCodeId $authCodeId): ?AuthCode |
|
108 | + public function find(AuthCodeId $authCodeId): ? AuthCode |
|
109 | 109 | { |
110 | 110 | $authCode = $this->getFromCache($authCodeId); |
111 | 111 | if (null === $authCode) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return AuthCode|null |
152 | 152 | */ |
153 | - private function getFromCache(AuthCodeId $authCodeId): ?AuthCode |
|
153 | + private function getFromCache(AuthCodeId $authCodeId): ? AuthCode |
|
154 | 154 | { |
155 | 155 | $itemKey = sprintf('oauth2-auth_code-%s', $authCodeId->getValue()); |
156 | 156 | if (null !== $this->cache) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | $parameters = [ |
70 | - 'oauth2_server.resource_owner_password_credentials_grant_type.user_account_manager' => ['type' => 'alias', 'path' => '[user_account_manager]'], |
|
70 | + 'oauth2_server.resource_owner_password_credentials_grant_type.user_account_manager' => ['type' => 'alias', 'path' => '[user_account_manager]'], |
|
71 | 71 | ]; |
72 | 72 | |
73 | 73 | $this->loadParameters($parameters, $pluginConfiguration, $container); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | $accessor = PropertyAccess::createPropertyAccessor(); |
68 | 68 | if (true === $accessor->getValue($pluginConfiguration, '[encryption][enabled]')) { |
69 | - $parameters['oauth2_server.jwt_bearer_grant_type.encryption.key_set'] = ['type' => 'alias', 'path' => '[encryption][key_set]']; |
|
69 | + $parameters['oauth2_server.jwt_bearer_grant_type.encryption.key_set'] = ['type' => 'alias', 'path' => '[encryption][key_set]']; |
|
70 | 70 | $parameters['oauth2_server.jwt_bearer_grant_type.encryption.required'] = ['type' => 'parameter', 'path' => '[encryption][required]']; |
71 | 71 | } |
72 | 72 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | private function isClientAssertionEncryptionParameterInvalid($parameter) |
209 | 209 | { |
210 | - return function ($data) use ($parameter) { |
|
210 | + return function($data) use ($parameter) { |
|
211 | 211 | if (false === $data['encryption']['enabled']) { |
212 | 212 | return false; |
213 | 213 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $parameters['oauth2_server.token_endpoint_auth_method.client_assertion_jwt.encryption.key_encryption_algorithms'] = ['type' => 'parameter', 'path' => '[token_endpoint_auth_methods][client_assertion_jwt][encryption][key_encryption_algorithms]']; |
111 | 111 | $parameters['oauth2_server.token_endpoint_auth_method.client_assertion_jwt.encryption.content_encryption_algorithms'] = ['type' => 'parameter', 'path' => '[token_endpoint_auth_methods][client_assertion_jwt][encryption][content_encryption_algorithms]']; |
112 | 112 | $parameters['oauth2_server.token_endpoint_auth_method.client_assertion_jwt.encryption.required'] = ['type' => 'parameter', 'path' => '[token_endpoint_auth_methods][client_assertion_jwt][encryption][required]']; |
113 | - $parameters['oauth2_server.token_endpoint_auth_method.client_assertion_jwt.encryption.key_set'] = ['type' => 'alias', 'path' => '[token_endpoint_auth_methods][client_assertion_jwt][encryption][key_set]']; |
|
113 | + $parameters['oauth2_server.token_endpoint_auth_method.client_assertion_jwt.encryption.key_set'] = ['type' => 'alias', 'path' => '[token_endpoint_auth_methods][client_assertion_jwt][encryption][key_set]']; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | ->info('The Client class.') |
157 | 157 | ->isRequired() |
158 | 158 | ->validate() |
159 | - ->ifTrue(function ($value) { |
|
159 | + ->ifTrue(function($value) { |
|
160 | 160 | return !class_exists($value); |
161 | 161 | }) |
162 | 162 | ->thenInvalid('The class does not exist.') |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | */ |
427 | 427 | private function areClientAssertionSignatureAlgorithmsInvalid() |
428 | 428 | { |
429 | - return function ($data) { |
|
429 | + return function($data) { |
|
430 | 430 | if (false === $data['enabled']) { |
431 | 431 | return false; |
432 | 432 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | */ |
443 | 443 | private function isClientAssertionEncryptionParameterInvalid($parameter) |
444 | 444 | { |
445 | - return function ($data) use ($parameter) { |
|
445 | + return function($data) use ($parameter) { |
|
446 | 446 | if (false === $data['encryption']['enabled']) { |
447 | 447 | return false; |
448 | 448 | } |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | */ |
457 | 457 | private function isClientSecretBasicRealmInvalid() |
458 | 458 | { |
459 | - return function ($data) { |
|
459 | + return function($data) { |
|
460 | 460 | if (false === $data['enabled']) { |
461 | 461 | return false; |
462 | 462 | } |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | */ |
471 | 471 | private function isRegistrationPathValid() |
472 | 472 | { |
473 | - return function ($data) { |
|
473 | + return function($data) { |
|
474 | 474 | return true === $data['enabled'] && empty($data['registration_path']); |
475 | 475 | }; |
476 | 476 | } |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | */ |
481 | 481 | private function isConfigurationPathValid() |
482 | 482 | { |
483 | - return function ($data) { |
|
483 | + return function($data) { |
|
484 | 484 | return true === $data['enabled'] && empty($data['configuration_path']); |
485 | 485 | }; |
486 | 486 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | */ |
491 | 491 | private function isInitialAccessTokenClassValid() |
492 | 492 | { |
493 | - return function ($data) { |
|
493 | + return function($data) { |
|
494 | 494 | return true === $data['enabled'] && (empty($data['class']) || !class_exists($data['class'])); |
495 | 495 | }; |
496 | 496 | } |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | */ |
501 | 501 | private function isInitialAccessTokenManagerValid() |
502 | 502 | { |
503 | - return function ($data) { |
|
503 | + return function($data) { |
|
504 | 504 | return true === $data['enabled'] && empty($data['class']); |
505 | 505 | }; |
506 | 506 | } |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | */ |
511 | 511 | private function isSoftwareStatementKeySetValid() |
512 | 512 | { |
513 | - return function ($data) { |
|
513 | + return function($data) { |
|
514 | 514 | return true === $data['enabled'] && empty($data['key_set']); |
515 | 515 | }; |
516 | 516 | } |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | */ |
521 | 521 | private function isSoftwareStatementAlgorithmValid() |
522 | 522 | { |
523 | - return function ($data) { |
|
523 | + return function($data) { |
|
524 | 524 | return true === $data['enabled'] && empty($data['signature_algorithm']); |
525 | 525 | }; |
526 | 526 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param FilterControllerEvent $event |
119 | 119 | * @param string $message |
120 | 120 | */ |
121 | - private function createAuthenticationException(FilterControllerEvent &$event, $message) |
|
121 | + private function createAuthenticationException(FilterControllerEvent & $event, $message) |
|
122 | 122 | { |
123 | 123 | $schemes = $this->tokenTypeManager->getSchemes(); |
124 | 124 | $exception = new OAuth2Exception( |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @param FilterControllerEvent $event |
138 | 138 | * @param string $message |
139 | 139 | */ |
140 | - private function createAccessDeniedException(FilterControllerEvent &$event, $message) |
|
140 | + private function createAccessDeniedException(FilterControllerEvent & $event, $message) |
|
141 | 141 | { |
142 | 142 | $exception = new OAuth2Exception( |
143 | 143 | 403, |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | * @param FilterControllerEvent $event |
155 | 155 | * @param OAuth2Exception $exception |
156 | 156 | */ |
157 | - private function updateFilterControllerEvent(FilterControllerEvent &$event, OAuth2Exception $exception) |
|
157 | + private function updateFilterControllerEvent(FilterControllerEvent & $event, OAuth2Exception $exception) |
|
158 | 158 | { |
159 | - $event->setController(function () use ($exception) { |
|
159 | + $event->setController(function() use ($exception) { |
|
160 | 160 | $response = new Response(); |
161 | 161 | //$exception->getHttpResponse($response); |
162 | 162 | $response->getBody()->rewind(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | private function getExpressionLanguage() |
65 | 65 | { |
66 | 66 | $language = new ExpressionLanguage(); |
67 | - $language->register('has', function ($str) { |
|
67 | + $language->register('has', function($str) { |
|
68 | 68 | return sprintf('(in_array(%1$s, scope))', $str); |
69 | - }, function ($arguments, $str) { |
|
69 | + }, function($arguments, $str) { |
|
70 | 70 | return in_array($str, $arguments['scope']); |
71 | 71 | }); |
72 | 72 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /* |
6 | 6 | * The MIT License (MIT) |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | private function getParametersToCheck(): array |
126 | 126 | { |
127 | 127 | return [ |
128 | - 'id' => function ($value, AccessToken $accessToken) { |
|
128 | + 'id' => function($value, AccessToken $accessToken) { |
|
129 | 129 | return hash_equals($accessToken->getTokenId()->getValue(), $value); |
130 | 130 | }, |
131 | - 'ts' => function ($value) { |
|
131 | + 'ts' => function($value) { |
|
132 | 132 | return time() < $this->getTimestampLifetime() + (int) $value; |
133 | 133 | }, |
134 | - 'nonce' => function () { |
|
134 | + 'nonce' => function() { |
|
135 | 135 | return true; |
136 | 136 | }, |
137 | 137 | ]; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * |
193 | 193 | * @return bool |
194 | 194 | */ |
195 | - private function isHeaderValid(string $header, array &$additionalCredentialValues, string &$token = null): bool |
|
195 | + private function isHeaderValid(string $header, array &$additionalCredentialValues, string & $token = null): bool |
|
196 | 196 | { |
197 | 197 | if (1 === preg_match('/(\w+)=("((?:[^"\\\\]|\\\\.)+)"|([^\s,$]+))/', $header, $matches)) { |
198 | 198 | preg_match_all('/(\w+)=("((?:[^"\\\\]|\\\\.)+)"|([^\s,$]+))/', $header, $matches, PREG_SET_ORDER); |