diff options
Diffstat (limited to 'Exception')
-rw-r--r-- | Exception/AccessDeniedException.php | 25 | ||||
-rw-r--r-- | Exception/AccountExpiredException.php | 21 | ||||
-rw-r--r-- | Exception/AccountStatusException.php | 22 | ||||
-rw-r--r-- | Exception/AuthenticationCredentialsNotFoundException.php | 22 | ||||
-rw-r--r-- | Exception/AuthenticationException.php | 41 | ||||
-rw-r--r-- | Exception/AuthenticationServiceException.php | 21 | ||||
-rw-r--r-- | Exception/BadCredentialsException.php | 25 | ||||
-rw-r--r-- | Exception/CredentialsExpiredException.php | 21 | ||||
-rw-r--r-- | Exception/DisabledException.php | 21 | ||||
-rw-r--r-- | Exception/InsufficientAuthenticationException.php | 23 | ||||
-rw-r--r-- | Exception/LockedException.php | 21 | ||||
-rw-r--r-- | Exception/NonceExpiredException.php | 27 | ||||
-rw-r--r-- | Exception/ProviderNotFoundException.php | 22 | ||||
-rw-r--r-- | Exception/UsernameNotFoundException.php | 21 |
14 files changed, 333 insertions, 0 deletions
diff --git a/Exception/AccessDeniedException.php b/Exception/AccessDeniedException.php new file mode 100644 index 0000000..6a48d89 --- /dev/null +++ b/Exception/AccessDeniedException.php @@ -0,0 +1,25 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * AccessDeniedException is thrown when the account has not the required role. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class AccessDeniedException extends \RuntimeException +{ + public function __construct($message = '', $code = 403, \Exception $previous = null) + { + parent::__construct($message, 403, $previous); + } +} diff --git a/Exception/AccountExpiredException.php b/Exception/AccountExpiredException.php new file mode 100644 index 0000000..d61a191 --- /dev/null +++ b/Exception/AccountExpiredException.php @@ -0,0 +1,21 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * AccountExpiredException is thrown when the user account has expired. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class AccountExpiredException extends AccountStatusException +{ +} diff --git a/Exception/AccountStatusException.php b/Exception/AccountStatusException.php new file mode 100644 index 0000000..4c06cbf --- /dev/null +++ b/Exception/AccountStatusException.php @@ -0,0 +1,22 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * AccountStatusException is the base class for authentication exceptions + * caused by the user account status. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +abstract class AccountStatusException extends AuthenticationException +{ +} diff --git a/Exception/AuthenticationCredentialsNotFoundException.php b/Exception/AuthenticationCredentialsNotFoundException.php new file mode 100644 index 0000000..248df79 --- /dev/null +++ b/Exception/AuthenticationCredentialsNotFoundException.php @@ -0,0 +1,22 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * AuthenticationCredentialsNotFoundException is thrown when an authentication is rejected + * because no Token is available. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class AuthenticationCredentialsNotFoundException extends AuthenticationException +{ +} diff --git a/Exception/AuthenticationException.php b/Exception/AuthenticationException.php new file mode 100644 index 0000000..939139b --- /dev/null +++ b/Exception/AuthenticationException.php @@ -0,0 +1,41 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +use Symfony\Component\Security\Authentication\Token\TokenInterface; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * AuthenticationException is the base class for all authentication exceptions. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class AuthenticationException extends \RuntimeException +{ + protected $token; + + public function __construct($message, TokenInterface $token = null, $code = 0, \Exception $previous = null) + { + parent::__construct($message, $code, $previous); + + $this->token = $token; + } + + public function getToken() + { + return $this->token; + } + + public function setToken(TokenInterface $token) + { + $this->token = $token; + } +} diff --git a/Exception/AuthenticationServiceException.php b/Exception/AuthenticationServiceException.php new file mode 100644 index 0000000..bf10449 --- /dev/null +++ b/Exception/AuthenticationServiceException.php @@ -0,0 +1,21 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * AuthenticationServiceException is thrown when an authentication request could not be processed due to a system problem. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class AuthenticationServiceException extends AuthenticationException +{ +} diff --git a/Exception/BadCredentialsException.php b/Exception/BadCredentialsException.php new file mode 100644 index 0000000..3e6ddf8 --- /dev/null +++ b/Exception/BadCredentialsException.php @@ -0,0 +1,25 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * BadCredentialsException is thrown when the user credentials are invalid. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class BadCredentialsException extends AuthenticationException +{ + public function __construct($message, $code = 0, \Exception $previous = null) + { + parent::__construct($message, null, $code, $previous); + } +} diff --git a/Exception/CredentialsExpiredException.php b/Exception/CredentialsExpiredException.php new file mode 100644 index 0000000..480031c --- /dev/null +++ b/Exception/CredentialsExpiredException.php @@ -0,0 +1,21 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * CredentialsExpiredException is thrown when the user account credentials have expired. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class CredentialsExpiredException extends AccountStatusException +{ +} diff --git a/Exception/DisabledException.php b/Exception/DisabledException.php new file mode 100644 index 0000000..4d853d7 --- /dev/null +++ b/Exception/DisabledException.php @@ -0,0 +1,21 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * DisabledException is thrown when the user account is disabled. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class DisabledException extends AccountStatusException +{ +} diff --git a/Exception/InsufficientAuthenticationException.php b/Exception/InsufficientAuthenticationException.php new file mode 100644 index 0000000..e2d2fcd --- /dev/null +++ b/Exception/InsufficientAuthenticationException.php @@ -0,0 +1,23 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * InsufficientAuthenticationException is thrown if the user credentials are not sufficiently trusted. + * + * This is the case when a user is anonymous and the resource to be displayed has an access role. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class InsufficientAuthenticationException extends AuthenticationException +{ +} diff --git a/Exception/LockedException.php b/Exception/LockedException.php new file mode 100644 index 0000000..7e801e3 --- /dev/null +++ b/Exception/LockedException.php @@ -0,0 +1,21 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * LockedException is thrown if the user account is locked. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class LockedException extends AccountStatusException +{ +} diff --git a/Exception/NonceExpiredException.php b/Exception/NonceExpiredException.php new file mode 100644 index 0000000..42fc21b --- /dev/null +++ b/Exception/NonceExpiredException.php @@ -0,0 +1,27 @@ +<?php + +namespace Symfony\Component\HttpKernel\Security\EntryPoint; + +use Symfony\Component\Security\Exception\AuthenticationException; +use Symfony\Component\Security\Authentication\EntryPoint\AuthenticationEntryPointInterface; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Log\LoggerInterface; + +/* + * This file is part of the Symfony framework. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * NonceExpiredException is thrown when an authentication is rejected because + * the digest nonce has expired. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class NonceExpiredException extends AuthenticationException +{ +} diff --git a/Exception/ProviderNotFoundException.php b/Exception/ProviderNotFoundException.php new file mode 100644 index 0000000..257ebfa --- /dev/null +++ b/Exception/ProviderNotFoundException.php @@ -0,0 +1,22 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * ProviderNotFoundException is thrown when no AuthenticationProviderInterface instance + * supports an authentication Token. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class ProviderNotFoundException extends AuthenticationException +{ +} diff --git a/Exception/UsernameNotFoundException.php b/Exception/UsernameNotFoundException.php new file mode 100644 index 0000000..f126c23 --- /dev/null +++ b/Exception/UsernameNotFoundException.php @@ -0,0 +1,21 @@ +<?php + +namespace Symfony\Component\Security\Exception; + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * UsernameNotFoundException is thrown if a User cannot be found by its username. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class UsernameNotFoundException extends AuthenticationException +{ +} |