@@ -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) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $parameters = [ |
| 49 | 49 | 'oauth2_server.scope_manager.scope_policy' => ['type' => 'parameter', 'path' => '[policy]'], |
| 50 | - 'oauth2_server.scope.available_scope' => ['type' => 'parameter', 'path' => '[available_scope]', 'callback' => function ($value) { |
|
| 50 | + 'oauth2_server.scope.available_scope' => ['type' => 'parameter', 'path' => '[available_scope]', 'callback' => function($value) { |
|
| 51 | 51 | return array_unique($value); |
| 52 | 52 | }], |
| 53 | 53 | ]; |
@@ -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) |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | 'oauth2_server.jwt_access_token.manager.issuer' => ['type' => 'parameter', 'path' => '[issuer]'], |
| 53 | 53 | 'oauth2_server.jwt_access_token.manager.token_lifetime' => ['type' => 'parameter', 'path' => '[token_lifetime]'], |
| 54 | 54 | 'oauth2_server.jwt_access_token.manager.signature_algorithm' => ['type' => 'parameter', 'path' => '[signature_algorithm]'], |
| 55 | - 'oauth2_server.jwt_access_token.manager.signature_key_set' => ['type' => 'alias', 'path' => '[signature_key_set]'], |
|
| 55 | + 'oauth2_server.jwt_access_token.manager.signature_key_set' => ['type' => 'alias', 'path' => '[signature_key_set]'], |
|
| 56 | 56 | 'oauth2_server.jwt_access_token.manager.key_encryption_algorithm' => ['type' => 'parameter', 'path' => '[key_encryption_algorithm]'], |
| 57 | 57 | 'oauth2_server.jwt_access_token.manager.content_encryption_algorithm' => ['type' => 'parameter', 'path' => '[content_encryption_algorithm]'], |
| 58 | 58 | 'oauth2_server.jwt_access_token.manager.claim_checkers' => ['type' => 'parameter', 'path' => '[claim_checkers]'], |
| 59 | 59 | 'oauth2_server.jwt_access_token.manager.header_checkers' => ['type' => 'parameter', 'path' => '[header_checkers]'], |
| 60 | - 'oauth2_server.jwt_access_token.manager.key_encryption_key_set' => ['type' => 'alias', 'path' => '[key_encryption_key_set]'], |
|
| 60 | + 'oauth2_server.jwt_access_token.manager.key_encryption_key_set' => ['type' => 'alias', 'path' => '[key_encryption_key_set]'], |
|
| 61 | 61 | ]; |
| 62 | 62 | |
| 63 | 63 | $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) |
@@ -75,17 +75,17 @@ discard block |
||
| 75 | 75 | ->children() |
| 76 | 76 | ->arrayNode('session_management') |
| 77 | 77 | ->validate() |
| 78 | - ->ifTrue(function ($value) { |
|
| 78 | + ->ifTrue(function($value) { |
|
| 79 | 79 | return $value['enabled'] && empty($value['path']); |
| 80 | 80 | })->thenInvalid('The option "path" must be set when the Session Management is enabled.') |
| 81 | 81 | ->end() |
| 82 | 82 | ->validate() |
| 83 | - ->ifTrue(function ($value) { |
|
| 83 | + ->ifTrue(function($value) { |
|
| 84 | 84 | return $value['enabled'] && empty($value['storage_name']); |
| 85 | 85 | })->thenInvalid('The option "storage_name" must be set when the Session Management is enabled.') |
| 86 | 86 | ->end() |
| 87 | 87 | ->validate() |
| 88 | - ->ifTrue(function ($value) { |
|
| 88 | + ->ifTrue(function($value) { |
|
| 89 | 89 | return $value['enabled'] && empty($value['template']); |
| 90 | 90 | })->thenInvalid('The option "template" must be set when the Session Management is enabled.') |
| 91 | 91 | ->end() |
@@ -316,10 +316,10 @@ discard block |
||
| 316 | 316 | 'oauth2_server.openid_connect.userinfo_endpoint.signature.enabled' => ['type' => 'parameter', 'path' => '[userinfo_endpoint][signature][enabled]'], |
| 317 | 317 | 'oauth2_server.openid_connect.metadata.enabled' => ['type' => 'parameter', 'path' => '[metadata][enabled]'], |
| 318 | 318 | 'oauth2_server.openid_connect.id_token.response_type.id_token' => ['type' => 'parameter', 'path' => '[response_type][id_token]'], |
| 319 | - 'oauth2_server.openid_connect.claims_supported' => ['type' => 'parameter', 'path' => '[claims_supported]', 'callback' => function ($data) { |
|
| 319 | + 'oauth2_server.openid_connect.claims_supported' => ['type' => 'parameter', 'path' => '[claims_supported]', 'callback' => function($data) { |
|
| 320 | 320 | return array_unique($data); |
| 321 | 321 | }], |
| 322 | - 'oauth2_server.openid_connect.claims_locales_supported' => ['type' => 'parameter', 'path' => '[claims_locales_supported]', 'callback' => function ($data) { |
|
| 322 | + 'oauth2_server.openid_connect.claims_locales_supported' => ['type' => 'parameter', 'path' => '[claims_locales_supported]', 'callback' => function($data) { |
|
| 323 | 323 | return array_unique($data); |
| 324 | 324 | }], |
| 325 | 325 | ]; |
@@ -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) |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | ->isRequired() |
| 47 | 47 | ->addDefaultsIfNotSet() |
| 48 | 48 | ->validate() |
| 49 | - ->ifTrue(function ($value) { |
|
| 49 | + ->ifTrue(function($value) { |
|
| 50 | 50 | return $value['min_length'] >= $value['max_length']; |
| 51 | 51 | }) |
| 52 | 52 | ->thenInvalid('The configuration option "min_length" must be lower than "max_length".') |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ->info('Authorization Code class.') |
| 57 | 57 | ->isRequired() |
| 58 | 58 | ->validate() |
| 59 | - ->ifTrue(function ($value) { |
|
| 59 | + ->ifTrue(function($value) { |
|
| 60 | 60 | return !class_exists($value); |
| 61 | 61 | }) |
| 62 | 62 | ->thenInvalid('The class does not exist.') |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | 'oauth2_server.auth_code.lifetime' => ['type' => 'parameter', 'path' => '[lifetime]'], |
| 115 | 115 | 'oauth2_server.auth_code.enforce_pkce' => ['type' => 'parameter', 'path' => '[enforce_pkce]'], |
| 116 | 116 | 'oauth2_server.auth_code.allow_public_clients' => ['type' => 'parameter', 'path' => '[allow_public_clients]'], |
| 117 | - 'oauth2_server.auth_code.manager' => ['type' => 'alias', 'path' => '[manager]'], |
|
| 117 | + 'oauth2_server.auth_code.manager' => ['type' => 'alias', 'path' => '[manager]'], |
|
| 118 | 118 | ]; |
| 119 | 119 | $this->loadParameters($parameters, $pluginConfiguration, $container); |
| 120 | 120 | } |