Skip to content

Commit 0652225

Browse files
committed
[Security] Deprecate PassportInterface
1 parent d642f76 commit 0652225

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

src/Symfony/Component/Ldap/Security/LdapAuthenticator.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1717
use Symfony\Component\Security\Core\Exception\AuthenticationException;
1818
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
19+
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
1920
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
2021

2122
/**
@@ -53,7 +54,7 @@ public function supports(Request $request): ?bool
5354
return $this->authenticator->supports($request);
5455
}
5556

56-
public function authenticate(Request $request): PassportInterface
57+
public function authenticate(Request $request): Passport
5758
{
5859
$passport = $this->authenticator->authenticate($request);
5960
$passport->addBadge(new LdapBadge($this->ldapServiceId, $this->dnString, $this->searchDn, $this->searchPassword, $this->queryString));

src/Symfony/Component/Security/Http/Authenticator/AuthenticatorInterface.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1717
use Symfony\Component\Security\Core\Exception\AuthenticationException;
18+
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
1819
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
1920

2021
/**
@@ -47,8 +48,10 @@ public function supports(Request $request): ?bool;
4748
* a UserNotFoundException when the user cannot be found).
4849
*
4950
* @throws AuthenticationException
51+
*
52+
* @return Passport
5053
*/
51-
public function authenticate(Request $request): PassportInterface;
54+
public function authenticate(Request $request); /*: Passport;*/
5255

5356
/**
5457
* Create an authenticated token for the given user.
@@ -59,7 +62,7 @@ public function authenticate(Request $request): PassportInterface;
5962
*
6063
* @see AbstractAuthenticator
6164
*
62-
* @param PassportInterface $passport The passport returned from authenticate()
65+
* @param Passport $passport The passport returned from authenticate()
6366
*/
6467
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface;
6568

src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function supports(Request $request): bool
7777
&& $this->httpUtils->checkRequestPath($request, $this->options['check_path']);
7878
}
7979

80-
public function authenticate(Request $request): PassportInterface
80+
public function authenticate(Request $request): Passport
8181
{
8282
$credentials = $this->getCredentials($request);
8383

src/Symfony/Component/Security/Http/Authenticator/Passport/PassportInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* passport.
2222
*
2323
* @author Wouter de Jong <wouter@wouterj.nl>
24+
*
25+
* @deprecated since Symfony 5.4, use {@link Passport} instead
2426
*/
2527
interface PassportInterface
2628
{

src/Symfony/Component/Security/Http/Authenticator/Passport/UserPassportInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* Represents a passport for a Security User.
1919
*
2020
* @author Wouter de Jong <wouter@wouterj.nl>
21+
*
22+
* @deprecated since Symfony 5.4, use {@link Passport} instead
2123
*/
2224
interface UserPassportInterface extends PassportInterface
2325
{

src/Symfony/Component/Security/Http/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* Deprecate not setting the 5th argument (`$exceptionOnNoToken`) of `AccessListener` to `false`
88
* Deprecate `DeauthenticatedEvent`, use `TokenDeauthenticatedEvent` instead
9+
* Deprecate `PassportInterface`, use `Passport` instead
910

1011
5.3
1112
---

0 commit comments

Comments
 (0)