Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/tests export-ignore
/dev export-ignore
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist export-ignore
/docker-compose.yml export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpunit.xml.dist export-ignore
/.psalm.baseline.xml export-ignore
/psalm.xml export-ignore
/phpstan.dist.neon export-ignore
/tests export-ignore
11 changes: 0 additions & 11 deletions compose.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions tests/Unit/OAuth2AuthenticatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;

final class OAuth2AuthenticatorTest extends TestCase
Expand Down Expand Up @@ -132,41 +131,6 @@ public function testAuthenticateCreatePassportWithClientCredentialsUser(): void
$this->assertInstanceOf(ClientCredentialsUser::class, $passport->getUser());
}

/**
* @group legacy
*/
public function testCreateAuthenticatedToken(): void
{
if (!interface_exists(PassportInterface::class)) {
$this->markTestSkipped('Irrelevant on Symfony 6+');
}

$userBadge = new UserBadge('oauthClientId', static function (): UserInterface {
return new ClientCredentialsUser('oauthClientId');
});

$passport = new SelfValidatingPassport($userBadge, [
new ScopeBadge(['scope_one', 'scope_two']),
]);
$passport->setAttribute('accessTokenId', 'accessTokenId');
$passport->setAttribute('oauthClientId', 'oauthClientId');

$authenticator = new OAuth2Authenticator(
$this->createMock(HttpMessageFactoryInterface::class),
$this->createMock(ResourceServer::class),
$this->createMock(TestUserProvider::class),
'PREFIX_'
);

$token = $authenticator->createAuthenticatedToken($passport, 'firewallName');

$this->assertSame(['scope_one', 'scope_two'], $token->getScopes());
$this->assertSame('accessTokenId', $token->getCredentials());
$this->assertInstanceOf(ClientCredentialsUser::class, $token->getUser());
$this->assertSame('oauthClientId', $token->getUser()->getUserIdentifier());
$this->assertTrue($token->isAuthenticated());
}

public function testCreateToken(): void
{
$userBadge = new UserBadge('userIdentifier', static function (): UserInterface {
Expand Down