diff options
author | Johannes M. Schmitt <schmittjoh@gmail.com> | 2011-01-26 21:34:11 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2011-01-26 22:23:20 +0100 |
commit | bebc09870cb0a7720e2c6a8c5c74585e69e8bb24 (patch) | |
tree | 0c399647cdbe504be405017e7cc04c70c53482f2 /Core/Exception | |
parent | c85f3d708d2c9b00d73ca1234ccfaf50336d94b1 (diff) | |
download | symfony-security-bebc09870cb0a7720e2c6a8c5c74585e69e8bb24.zip symfony-security-bebc09870cb0a7720e2c6a8c5c74585e69e8bb24.tar.gz symfony-security-bebc09870cb0a7720e2c6a8c5c74585e69e8bb24.tar.bz2 |
namespace changes
Symfony\Component\Security -> Symfony\Component\Security\Core
Symfony\Component\Security\Acl remains unchanged
Symfony\Component\HttpKernel\Security -> Symfony\Component\Security\Http
Diffstat (limited to 'Core/Exception')
-rw-r--r-- | Core/Exception/AccessDeniedException.php | 25 | ||||
-rw-r--r-- | Core/Exception/AccountExpiredException.php | 21 | ||||
-rw-r--r-- | Core/Exception/AccountStatusException.php | 22 | ||||
-rw-r--r-- | Core/Exception/AuthenticationCredentialsNotFoundException.php | 22 | ||||
-rw-r--r-- | Core/Exception/AuthenticationException.php | 39 | ||||
-rw-r--r-- | Core/Exception/AuthenticationServiceException.php | 21 | ||||
-rw-r--r-- | Core/Exception/BadCredentialsException.php | 25 | ||||
-rw-r--r-- | Core/Exception/CookieTheftException.php | 22 | ||||
-rw-r--r-- | Core/Exception/CredentialsExpiredException.php | 21 | ||||
-rw-r--r-- | Core/Exception/DisabledException.php | 21 | ||||
-rw-r--r-- | Core/Exception/InsufficientAuthenticationException.php | 23 | ||||
-rw-r--r-- | Core/Exception/LockedException.php | 21 | ||||
-rw-r--r-- | Core/Exception/NonceExpiredException.php | 27 | ||||
-rw-r--r-- | Core/Exception/ProviderNotFoundException.php | 22 | ||||
-rw-r--r-- | Core/Exception/TokenNotFoundException.php | 20 | ||||
-rw-r--r-- | Core/Exception/UnsupportedAccountException.php | 22 | ||||
-rw-r--r-- | Core/Exception/UsernameNotFoundException.php | 21 |
17 files changed, 395 insertions, 0 deletions
diff --git a/Core/Exception/AccessDeniedException.php b/Core/Exception/AccessDeniedException.php new file mode 100644 index 0000000..d065ed7 --- /dev/null +++ b/Core/Exception/AccessDeniedException.php @@ -0,0 +1,25 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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 = 'Access Denied', \Exception $previous = null) + { + parent::__construct($message, 403, $previous); + } +} diff --git a/Core/Exception/AccountExpiredException.php b/Core/Exception/AccountExpiredException.php new file mode 100644 index 0000000..f0a09f7 --- /dev/null +++ b/Core/Exception/AccountExpiredException.php @@ -0,0 +1,21 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * AccountExpiredException is thrown when the user account has expired. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class AccountExpiredException extends AccountStatusException +{ +} diff --git a/Core/Exception/AccountStatusException.php b/Core/Exception/AccountStatusException.php new file mode 100644 index 0000000..4828d20 --- /dev/null +++ b/Core/Exception/AccountStatusException.php @@ -0,0 +1,22 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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/Core/Exception/AuthenticationCredentialsNotFoundException.php b/Core/Exception/AuthenticationCredentialsNotFoundException.php new file mode 100644 index 0000000..4f95127 --- /dev/null +++ b/Core/Exception/AuthenticationCredentialsNotFoundException.php @@ -0,0 +1,22 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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/Core/Exception/AuthenticationException.php b/Core/Exception/AuthenticationException.php new file mode 100644 index 0000000..a43b998 --- /dev/null +++ b/Core/Exception/AuthenticationException.php @@ -0,0 +1,39 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * AuthenticationException is the base class for all authentication exceptions. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class AuthenticationException extends \RuntimeException +{ + protected $extraInformation; + + public function __construct($message, $extraInformation = null, $code = 0, \Exception $previous = null) + { + parent::__construct($message, $code, $previous); + + $this->extraInformation = $extraInformation; + } + + public function getExtraInformation() + { + return $this->extraInformation; + } + + public function setExtraInformation($extraInformation) + { + $this->extraInformation = $extraInformation; + } +} diff --git a/Core/Exception/AuthenticationServiceException.php b/Core/Exception/AuthenticationServiceException.php new file mode 100644 index 0000000..02fcc2f --- /dev/null +++ b/Core/Exception/AuthenticationServiceException.php @@ -0,0 +1,21 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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/Core/Exception/BadCredentialsException.php b/Core/Exception/BadCredentialsException.php new file mode 100644 index 0000000..797a806 --- /dev/null +++ b/Core/Exception/BadCredentialsException.php @@ -0,0 +1,25 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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/Core/Exception/CookieTheftException.php b/Core/Exception/CookieTheftException.php new file mode 100644 index 0000000..64a06ca --- /dev/null +++ b/Core/Exception/CookieTheftException.php @@ -0,0 +1,22 @@ +<?php + +namespace Symfony\Component\Security\Core\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. + */ + +/** + * This exception is thrown when the RememberMeServices implementation + * detects that a presented cookie has already been used by someone else. + * + * @author Johannes M. Schmitt <schmittjoh@gmail.com> + */ +class CookieTheftException extends AuthenticationException +{ +}
\ No newline at end of file diff --git a/Core/Exception/CredentialsExpiredException.php b/Core/Exception/CredentialsExpiredException.php new file mode 100644 index 0000000..43ba982 --- /dev/null +++ b/Core/Exception/CredentialsExpiredException.php @@ -0,0 +1,21 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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/Core/Exception/DisabledException.php b/Core/Exception/DisabledException.php new file mode 100644 index 0000000..fd87947 --- /dev/null +++ b/Core/Exception/DisabledException.php @@ -0,0 +1,21 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * DisabledException is thrown when the user account is disabled. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class DisabledException extends AccountStatusException +{ +} diff --git a/Core/Exception/InsufficientAuthenticationException.php b/Core/Exception/InsufficientAuthenticationException.php new file mode 100644 index 0000000..3fbba35 --- /dev/null +++ b/Core/Exception/InsufficientAuthenticationException.php @@ -0,0 +1,23 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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/Core/Exception/LockedException.php b/Core/Exception/LockedException.php new file mode 100644 index 0000000..8ea820f --- /dev/null +++ b/Core/Exception/LockedException.php @@ -0,0 +1,21 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * LockedException is thrown if the user account is locked. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class LockedException extends AccountStatusException +{ +} diff --git a/Core/Exception/NonceExpiredException.php b/Core/Exception/NonceExpiredException.php new file mode 100644 index 0000000..5e6a0c5 --- /dev/null +++ b/Core/Exception/NonceExpiredException.php @@ -0,0 +1,27 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\HttpKernel\Security\EntryPoint; + +use Symfony\Component\Security\Core\Exception\AuthenticationException; +use Symfony\Component\Security\Core\Authentication\EntryPoint\AuthenticationEntryPointInterface; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Log\LoggerInterface; + +/** + * 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/Core/Exception/ProviderNotFoundException.php b/Core/Exception/ProviderNotFoundException.php new file mode 100644 index 0000000..50112c5 --- /dev/null +++ b/Core/Exception/ProviderNotFoundException.php @@ -0,0 +1,22 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * 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/Core/Exception/TokenNotFoundException.php b/Core/Exception/TokenNotFoundException.php new file mode 100644 index 0000000..1c13421 --- /dev/null +++ b/Core/Exception/TokenNotFoundException.php @@ -0,0 +1,20 @@ +<?php +namespace Symfony\Component\Security\Core\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. + */ + +/** + * TokenNotFoundException is thrown if a Token cannot be found. + * + * @author Johannes M. Schmitt <schmittjoh@gmail.com> + */ +class TokenNotFoundException extends AuthenticationException +{ +} diff --git a/Core/Exception/UnsupportedAccountException.php b/Core/Exception/UnsupportedAccountException.php new file mode 100644 index 0000000..0704b65 --- /dev/null +++ b/Core/Exception/UnsupportedAccountException.php @@ -0,0 +1,22 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * This exception is thrown when an account is reloaded from a provider which + * doesn't support the passed implementation of AccountInterface. + * + * @author Johannes M. Schmitt <schmittjoh@gmail.com> + */ +class UnsupportedAccountException extends AuthenticationServiceException +{ +}
\ No newline at end of file diff --git a/Core/Exception/UsernameNotFoundException.php b/Core/Exception/UsernameNotFoundException.php new file mode 100644 index 0000000..a1733fe --- /dev/null +++ b/Core/Exception/UsernameNotFoundException.php @@ -0,0 +1,21 @@ +<?php + +/* + * 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. + */ + +namespace Symfony\Component\Security\Core\Exception; + +/** + * UsernameNotFoundException is thrown if a User cannot be found by its username. + * + * @author Fabien Potencier <fabien.potencier@symfony-project.com> + */ +class UsernameNotFoundException extends AuthenticationException +{ +} |