From 681ea4d481f2b088449f0c8491747044a6216c2c Mon Sep 17 00:00:00 2001 From: Tomasz Kusy Date: Sun, 7 Dec 2025 10:25:04 +0100 Subject: [PATCH 1/2] feat: expose hide_existing_credentials in bundle registration section (#786) --- .../Factory/Security/WebauthnFactory.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, From 8d4a67e320d088422f5c3d32521332dff2f9823d Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Sat, 20 Dec 2025 21:04:42 +0100 Subject: [PATCH 2/2] chore: update PHPStan baseline for hide_existing_credentials Add baseline entries for the new hide_existing_credentials configuration option in WebauthnFactory, consistent with existing baseline entries for other configuration access patterns. --- .ci-tools/phpstan-baseline.neon | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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