Skip to content

Commit 7620660

Browse files
committed
Rename the default authenticator
1 parent e2eb9ba commit 7620660

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

config/services.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use BabDev\WebSocket\Server\WebSocket\Middleware\EstablishWebSocketConnection;
2626
use BabDev\WebSocketBundle\Authentication\Authenticator;
2727
use BabDev\WebSocketBundle\Authentication\ConnectionRepository;
28-
use BabDev\WebSocketBundle\Authentication\DefaultAuthenticator;
28+
use BabDev\WebSocketBundle\Authentication\ProviderBackedAuthenticator;
2929
use BabDev\WebSocketBundle\Authentication\Provider\SessionAuthenticationProvider;
3030
use BabDev\WebSocketBundle\Authentication\Storage\Driver\InMemoryStorageDriver;
3131
use BabDev\WebSocketBundle\Authentication\Storage\Driver\StorageDriver;
@@ -78,7 +78,7 @@
7878

7979
$services = $container->services();
8080

81-
$services->set('babdev_websocket_server.authentication.authenticator', DefaultAuthenticator::class)
81+
$services->set('babdev_websocket_server.authentication.authenticator', ProviderBackedAuthenticator::class)
8282
->args([
8383
abstract_arg('authentication providers'),
8484
service(TokenStorage::class),

src/Authentication/DefaultAuthenticator.php renamed to src/Authentication/ProviderBackedAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Psr\Log\LoggerAwareInterface;
1010
use Psr\Log\LoggerAwareTrait;
1111

12-
final class DefaultAuthenticator implements Authenticator, LoggerAwareInterface
12+
final class ProviderBackedAuthenticator implements Authenticator, LoggerAwareInterface
1313
{
1414
use LoggerAwareTrait;
1515

tests/Authentication/DefaultAuthenticatorTest.php renamed to tests/Authentication/ProviderBackedAuthenticatorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
namespace BabDev\WebSocketBundle\Tests\Authentication;
44

55
use BabDev\WebSocket\Server\Connection;
6-
use BabDev\WebSocketBundle\Authentication\DefaultAuthenticator;
6+
use BabDev\WebSocketBundle\Authentication\ProviderBackedAuthenticator;
77
use BabDev\WebSocketBundle\Authentication\Provider\AuthenticationProvider;
88
use BabDev\WebSocketBundle\Authentication\Storage\TokenStorage;
99
use PHPUnit\Framework\MockObject\MockObject;
1010
use PHPUnit\Framework\TestCase;
1111
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1212

13-
final class DefaultAuthenticatorTest extends TestCase
13+
final class ProviderBackedAuthenticatorTest extends TestCase
1414
{
1515
public function testTheAuthenticatorDoesNotAuthenticateAConnectionWhenItHasNoProviders(): void
1616
{
@@ -25,7 +25,7 @@ public function testTheAuthenticatorDoesNotAuthenticateAConnectionWhenItHasNoPro
2525
$tokenStorage->expects(self::never())
2626
->method('addToken');
2727

28-
new DefaultAuthenticator([], $tokenStorage)->authenticate($connection);
28+
new ProviderBackedAuthenticator([], $tokenStorage)->authenticate($connection);
2929
}
3030

3131
public function testTheAuthenticatorAuthenticatesAConnectionWhenItHasOneProvider(): void
@@ -59,7 +59,7 @@ public function testTheAuthenticatorAuthenticatesAConnectionWhenItHasOneProvider
5959
->with($connection)
6060
->willReturn($token);
6161

62-
new DefaultAuthenticator([$authenticationProvider], $tokenStorage)->authenticate($connection);
62+
new ProviderBackedAuthenticator([$authenticationProvider], $tokenStorage)->authenticate($connection);
6363
}
6464

6565
public function testTheAuthenticatorAuthenticatesAConnectionUsingTheFirstSupportedProvider(): void
@@ -111,6 +111,6 @@ public function testTheAuthenticatorAuthenticatesAConnectionUsingTheFirstSupport
111111
$authenticationProvider3->expects(self::never())
112112
->method('authenticate');
113113

114-
new DefaultAuthenticator([$authenticationProvider1, $authenticationProvider2, $authenticationProvider3], $tokenStorage)->authenticate($connection);
114+
new ProviderBackedAuthenticator([$authenticationProvider1, $authenticationProvider2, $authenticationProvider3], $tokenStorage)->authenticate($connection);
115115
}
116116
}

0 commit comments

Comments
 (0)