From a9549989492a48e6df25d5b196cf97ec18a65b11 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Sat, 9 Apr 2022 09:32:26 +0200 Subject: [PATCH] Useless classes removed --- .../Authentication/Token/WebauthnToken.php | 16 +------ .../Token/WebauthnTokenFactory.php | 44 ------------------- .../Token/WebauthnTokenFactoryInterface.php | 30 ------------- tests/symfony/unit/ConfigurationTest.php | 22 ++++++++++ 4 files changed, 24 insertions(+), 88 deletions(-) delete mode 100644 src/symfony/src/Security/Authentication/Token/WebauthnTokenFactory.php delete mode 100644 src/symfony/src/Security/Authentication/Token/WebauthnTokenFactoryInterface.php create mode 100644 tests/symfony/unit/ConfigurationTest.php diff --git a/src/symfony/src/Security/Authentication/Token/WebauthnToken.php b/src/symfony/src/Security/Authentication/Token/WebauthnToken.php index 0c6c9f1e..26c8424e 100644 --- a/src/symfony/src/Security/Authentication/Token/WebauthnToken.php +++ b/src/symfony/src/Security/Authentication/Token/WebauthnToken.php @@ -7,7 +7,6 @@ use Assert\Assertion; use const JSON_THROW_ON_ERROR; use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; -use Symfony\Component\Security\Core\User\UserInterface; use Webauthn\AuthenticationExtensions\AuthenticationExtensionsClientOutputs; use Webauthn\Bundle\Security\Authorization\Voter\IsUserPresentVoter; use Webauthn\Bundle\Security\Authorization\Voter\IsUserVerifiedVoter; @@ -17,15 +16,11 @@ class WebauthnToken extends AbstractToken implements WebauthnTokenInterface { - private string $firewallName; - - private PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity; - /** * {@inheritdoc} */ public function __construct( - PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity, + private PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity, private PublicKeyCredentialOptions $publicKeyCredentialOptions, private PublicKeyCredentialDescriptor $publicKeyCredentialDescriptor, private bool $isUserPresent, @@ -34,17 +29,10 @@ public function __construct( private int $reservedForFutureUse2, private int $signCount, private ?AuthenticationExtensionsClientOutputs $extensions, - string $firewallName, + private string $firewallName, array $roles = [] ) { parent::__construct($roles); - Assertion::notEmpty($firewallName, '$firewallName must not be empty.'); - - if ($publicKeyCredentialUserEntity instanceof UserInterface) { - $this->setUser($publicKeyCredentialUserEntity); - } - $this->publicKeyCredentialUserEntity = $publicKeyCredentialUserEntity; - $this->firewallName = $firewallName; } /** diff --git a/src/symfony/src/Security/Authentication/Token/WebauthnTokenFactory.php b/src/symfony/src/Security/Authentication/Token/WebauthnTokenFactory.php deleted file mode 100644 index 749c2e94..00000000 --- a/src/symfony/src/Security/Authentication/Token/WebauthnTokenFactory.php +++ /dev/null @@ -1,44 +0,0 @@ -