diff options
Diffstat (limited to 'Core')
-rw-r--r-- | Core/Authentication/Token/AnonymousToken.php | 2 | ||||
-rw-r--r-- | Core/Authentication/Token/PreAuthenticatedToken.php | 2 | ||||
-rw-r--r-- | Core/Security.php | 1 | ||||
-rw-r--r-- | Core/SecurityContextInterface.php | 1 |
4 files changed, 4 insertions, 2 deletions
diff --git a/Core/Authentication/Token/AnonymousToken.php b/Core/Authentication/Token/AnonymousToken.php index 22fc611..71dea32 100644 --- a/Core/Authentication/Token/AnonymousToken.php +++ b/Core/Authentication/Token/AnonymousToken.php @@ -26,7 +26,7 @@ class AnonymousToken extends AbstractToken * Constructor. * * @param string $secret A secret used to make sure the token is created by the app and not by a malicious client - * @param string $user The user + * @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string. * @param RoleInterface[] $roles An array of roles */ public function __construct($secret, $user, array $roles = array()) diff --git a/Core/Authentication/Token/PreAuthenticatedToken.php b/Core/Authentication/Token/PreAuthenticatedToken.php index 1798203..5a3fc95 100644 --- a/Core/Authentication/Token/PreAuthenticatedToken.php +++ b/Core/Authentication/Token/PreAuthenticatedToken.php @@ -26,7 +26,7 @@ class PreAuthenticatedToken extends AbstractToken /** * Constructor. * - * @param string|object $user The user + * @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string. * @param mixed $credentials The user credentials * @param string $providerKey The provider key * @param RoleInterface[]|string[] $roles An array of roles diff --git a/Core/Security.php b/Core/Security.php index 14d32f8..84cc77d 100644 --- a/Core/Security.php +++ b/Core/Security.php @@ -21,4 +21,5 @@ final class Security const ACCESS_DENIED_ERROR = '_security.403_error'; const AUTHENTICATION_ERROR = '_security.last_error'; const LAST_USERNAME = '_security.last_username'; + const MAX_USERNAME_LENGTH = 4096; } diff --git a/Core/SecurityContextInterface.php b/Core/SecurityContextInterface.php index 2a06ca4..73edd23 100644 --- a/Core/SecurityContextInterface.php +++ b/Core/SecurityContextInterface.php @@ -26,4 +26,5 @@ interface SecurityContextInterface extends TokenStorageInterface, AuthorizationC const ACCESS_DENIED_ERROR = Security::ACCESS_DENIED_ERROR; const AUTHENTICATION_ERROR = Security::AUTHENTICATION_ERROR; const LAST_USERNAME = Security::LAST_USERNAME; + const MAX_USERNAME_LENGTH = Security::MAX_USERNAME_LENGTH; } |