diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2014-01-18 10:09:36 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2014-01-18 10:09:36 +0100 |
commit | 666dcfb222822bd7ab620cd24631a24f12215bba (patch) | |
tree | 81d250e279d193338d6c166c4790b6ad40fe5e85 /Core/Encoder/EncoderAwareInterface.php | |
parent | b52a651fea45c1d8c74a864574c816ed3b6cc9f8 (diff) | |
parent | 97a2eea43b4dd655c4852b2242ee7dc52e8df873 (diff) | |
download | symfony-security-666dcfb222822bd7ab620cd24631a24f12215bba.zip symfony-security-666dcfb222822bd7ab620cd24631a24f12215bba.tar.gz symfony-security-666dcfb222822bd7ab620cd24631a24f12215bba.tar.bz2 |
feature #10005 [Security] Added named encoders to EncoderFactory (tamirvs)
This PR was squashed before being merged into the 2.5-dev branch (closes #10005).
Discussion
----------
[Security] Added named encoders to EncoderFactory
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9743
| License | MIT
| Doc PR | -
This PR is basically merging FOSAdvancedEncoder. I think it's better than having a separate bundle that most of it's code is a copy of the core.
A use case is: having a different encoders or bcrypt cost based on the user's roles.
Commits
-------
c69e2ca [Security] Added named encoders to EncoderFactory
Diffstat (limited to 'Core/Encoder/EncoderAwareInterface.php')
-rw-r--r-- | Core/Encoder/EncoderAwareInterface.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Core/Encoder/EncoderAwareInterface.php b/Core/Encoder/EncoderAwareInterface.php new file mode 100644 index 0000000..22ae820 --- /dev/null +++ b/Core/Encoder/EncoderAwareInterface.php @@ -0,0 +1,28 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.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\Encoder; + +/** + * @author Christophe Coevoet <stof@notk.org> + */ +interface EncoderAwareInterface +{ + /** + * Gets the name of the encoder used to encode the password. + * + * If the method returns null, the standard way to retrieve the encoder + * will be used instead. + * + * @return string + */ + public function getEncoderName(); +} |