[Security] Improve method signatures (minor)
This commit is contained in:
parent
fb90fb3bb7
commit
b009254090
@ -100,7 +100,7 @@ class FormLoginAuthenticator extends AbstractLoginFormAuthenticator
|
|||||||
/**
|
/**
|
||||||
* @param Passport $passport
|
* @param Passport $passport
|
||||||
*/
|
*/
|
||||||
public function createAuthenticatedToken(PassportInterface $passport, $firewallName): TokenInterface
|
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface
|
||||||
{
|
{
|
||||||
return new UsernamePasswordToken($passport->getUser(), null, $firewallName, $passport->getUser()->getRoles());
|
return new UsernamePasswordToken($passport->getUser(), null, $firewallName, $passport->getUser()->getRoles());
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ class HttpBasicAuthenticator implements AuthenticatorInterface, AuthenticationEn
|
|||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function start(Request $request, AuthenticationException $authException = null)
|
public function start(Request $request, AuthenticationException $authException = null): Response
|
||||||
{
|
{
|
||||||
$response = new Response();
|
$response = new Response();
|
||||||
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));
|
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));
|
||||||
@ -82,12 +82,12 @@ class HttpBasicAuthenticator implements AuthenticatorInterface, AuthenticationEn
|
|||||||
/**
|
/**
|
||||||
* @param Passport $passport
|
* @param Passport $passport
|
||||||
*/
|
*/
|
||||||
public function createAuthenticatedToken(PassportInterface $passport, $firewallName): TokenInterface
|
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface
|
||||||
{
|
{
|
||||||
return new UsernamePasswordToken($passport->getUser(), null, $firewallName, $passport->getUser()->getRoles());
|
return new UsernamePasswordToken($passport->getUser(), null, $firewallName, $passport->getUser()->getRoles());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $firewallName): ?Response
|
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Component\Security\Http\Authenticator\Passport;
|
namespace Symfony\Component\Security\Http\Authenticator\Passport;
|
||||||
|
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
|
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\BadgeInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation used when there are no credentials to be checked (e.g.
|
* An implementation used when there are no credentials to be checked (e.g.
|
||||||
@ -23,6 +24,9 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
|||||||
*/
|
*/
|
||||||
class SelfValidatingPassport extends Passport
|
class SelfValidatingPassport extends Passport
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @param BadgeInterface[] $badges
|
||||||
|
*/
|
||||||
public function __construct(UserInterface $user, array $badges = [])
|
public function __construct(UserInterface $user, array $badges = [])
|
||||||
{
|
{
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
Reference in New Issue
Block a user