diff --git a/.ci-tools/phpstan-baseline.neon b/.ci-tools/phpstan-baseline.neon index a678d9fc..be221ae3 100644 --- a/.ci-tools/phpstan-baseline.neon +++ b/.ci-tools/phpstan-baseline.neon @@ -543,6 +543,12 @@ parameters: count: 2 path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php + - + rawMessage: Cannot access offset 'hide_existing_credentials' on mixed. + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php + - rawMessage: Cannot access offset 'host' on mixed. identifier: offsetAccess.nonOffsetAccessible @@ -711,6 +717,12 @@ parameters: count: 1 path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php + - + rawMessage: 'Parameter #10 $hideExistingCredentials of method Webauthn\Bundle\DependencyInjection\Factory\Security\WebauthnFactory::createAttestationRequestControllerAndRoute() expects bool, mixed given.' + identifier: argument.type + count: 1 + path: ../src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php + - rawMessage: 'Parameter #3 $config of method Webauthn\Bundle\DependencyInjection\Factory\Security\WebauthnFactory::getAssertionOptionsBuilderId() expects array, mixed given.' identifier: argument.type diff --git a/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php b/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php index 960695b7..751135b6 100644 --- a/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php +++ b/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php @@ -176,6 +176,9 @@ public function addConfiguration(NodeDefinition $builder): void ->arrayNode('registration') ->canBeEnabled() ->children() + ->booleanNode('hide_existing_credentials') + ->defaultTrue() + ->end() ->scalarNode('profile') ->defaultValue('default') ->end() @@ -347,6 +350,7 @@ private function createAttestationControllersAndRoutes( $config['options_storage'], $config['registration']['options_handler'], $config['failure_handler'], + $config['registration']['hide_existing_credentials'], ); if ($config['registration']['routes']['result_path'] !== null) { $this->createResponseControllerAndRoute( @@ -401,6 +405,7 @@ private function createAttestationRequestControllerAndRoute( null|string $optionsStorageId, string $optionsHandlerId, string $failureHandlerId, + bool $hideExistingCredentials, ): void { $controller = (new Definition(AttestationRequestController::class)) ->setFactory([new Reference(AttestationControllerFactory::class), 'createRequestController']) @@ -410,7 +415,7 @@ private function createAttestationRequestControllerAndRoute( new Reference($optionsStorageId ?? OptionsStorage::class), new Reference($optionsHandlerId), new Reference($failureHandlerId), - true, + $hideExistingCredentials, ]); $this->createControllerAndRoute( $container,