Skip to content

Commit

Permalink
Useless classes removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky committed Apr 9, 2022
1 parent dfa5021 commit a954998
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 88 deletions.
16 changes: 2 additions & 14 deletions src/symfony/src/Security/Authentication/Token/WebauthnToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -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;
}

/**
Expand Down

This file was deleted.

This file was deleted.

22 changes: 22 additions & 0 deletions tests/symfony/unit/ConfigurationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace Webauthn\Tests\Bundle\Unit;

use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
use PHPUnit\Framework\TestCase;
use Webauthn\Bundle\DependencyInjection\Configuration;

/**
* @internal
*/
final class ConfigurationTest extends TestCase
{
use ConfigurationTestCaseTrait;

protected function getConfiguration(): Configuration
{
return new Configuration('webauthn');
}
}

0 comments on commit a954998

Please sign in to comment.