-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR was merged into the 2.0-dev branch. Discussion ---------- | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no (see UPGRADE-2.0.md) | Deprecations? | no | Tests pass? | yes | Fixed tickets | Closes #53 | License | MIT Commits ------- e61be8f Move constraints and others to a library 77b0ff6 Modernize the bundle’s code-base ebdcd33 Update documentation
- Loading branch information
Showing
49 changed files
with
533 additions
and
2,426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,83 @@ | ||
RollerworksPasswordStrengthBundle | ||
================================= | ||
|
||
This bundle provides a validator for ensuring strong passwords in Symfony2 applications. | ||
This Symfony-bundle integrates the Rollerworks [PasswordStrengthValidator][1] into your Symfony application. | ||
|
||
Passwords can be validated using either strength-levels (weak, medium, strong etc) | ||
or by configuring explicit requirements (needs letters, numbers etc) | ||
_The PasswordStrengthValidator provides various password strength validators for the Symfony Validator._ | ||
|
||
> This bundle provides the same level of functionality as the | ||
> [PasswordStrengthBundle](https://github.com/jbafford/PasswordStrengthBundle) created by John Bafford. | ||
> And is considered a replacement of the original bundle. | ||
## Installation | ||
|
||
### Step 1: Using Composer (recommended) | ||
|
||
To install RollerworksPasswordStrengthBundle with Composer just run: | ||
To install this package, add `rollerworks/password-strength-bundle` to your composer.json: | ||
|
||
```bash | ||
$ php composer.phar require rollerworks/password-strength-bundle | ||
``` | ||
|
||
Now, Composer will automatically download all required files, and install them | ||
Now, [Composer][2] will automatically download all required files, and install them | ||
for you. | ||
|
||
### Step2: Enable the bundle | ||
|
||
**Note:** This step is **not** required for Symfony Flex. | ||
|
||
Enable the bundle in the kernel: | ||
|
||
```php | ||
<?php | ||
|
||
// in AppKernel::registerBundles() | ||
$bundles = array( | ||
$bundles = [ | ||
// ... | ||
new Rollerworks\Bundle\PasswordStrengthBundle\RollerworksPasswordStrengthBundle(), | ||
// ... | ||
); | ||
]; | ||
``` | ||
|
||
## Requirements | ||
|
||
You need at least PHP 5.6 or PHP 7.0, mbstring is recommended but not required. | ||
For the provided blacklist providers you may need SQLite3 or a PDO compatible driver. | ||
|
||
Congratulations! You're ready! | ||
|
||
## Basic Usage | ||
|
||
**Caution:** | ||
Documentation for the various constraints can be found in the [PasswordStrengthValidator][1] package. | ||
See the [bundle reference configuration](docs/configuration.md) to configure usage with this bundle. | ||
|
||
## Versioning | ||
|
||
> The password validators do not enforce that the field must have a value! | ||
> To make a field "required" use the [NotBlank constraint](http://symfony.com/doc/current/reference/constraints/NotBlank.html) | ||
> in combination with the password validator(s). | ||
For transparency and insight into the release cycle, and for striving | ||
to maintain backward compatibility, this package is maintained under | ||
the Semantic Versioning guidelines as much as possible. | ||
|
||
### [Strength validation](docs/strength-validation.md) | ||
Releases will be numbered with the following format: | ||
|
||
Validates the passwords strength-level (weak, medium, strong etc). | ||
`<major>.<minor>.<patch>` | ||
|
||
### [Requirements validation](docs/requirements-validation.md) | ||
And constructed with the following guidelines: | ||
|
||
Validates the passwords using explicitly configured requirements (letters, caseDiff, numbers, requireSpecialCharacter). | ||
* Breaking backward compatibility bumps the major (and resets the minor and patch) | ||
* New additions without breaking backward compatibility bumps the minor (and resets the patch) | ||
* Bug fixes and misc changes bumps the patch | ||
|
||
### [Password blacklisting](docs/blacklist.md) | ||
For more information on SemVer, please visit <http://semver.org/>. | ||
|
||
There are times you want forbid (blacklist) a password from usage. | ||
## License | ||
|
||
Passwords are blacklisted using providers which can either an array or | ||
(flat-file) database (which you can update regularly). | ||
This library is released under the [MIT license](LICENSE). | ||
|
||
With the default installation the following providers can be used. | ||
## Contributing | ||
|
||
* Noop: Default provider, does nothing. | ||
* Array: Simple in memory blacklist provider (not recommended for big lists) | ||
* Sqlite: Provides the blacklist using a SQLite3 database file. | ||
* Pdo: Provides the blacklist using the PDO extension. | ||
This is an open source project. If you'd like to contribute, | ||
please read the [Contributing Guidelines][3]. If you're submitting | ||
a pull request, please follow the guidelines in the [Submitting a Patch][4] section. | ||
|
||
But building your own is also possible. | ||
__Documentation on this is currently missing, | ||
see current providers for more information.__ | ||
[1]: https://github.com/rollerworks/PasswordStrengthValidator | ||
[2]: https://getcomposer.org/doc/00-intro.md | ||
[3]: https://github.com/rollerworks/contributing | ||
[4]: https://contributing.readthedocs.org/en/latest/code/patches.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
UPGRADE FROM 1.x to 2.0 | ||
======================= | ||
|
||
Most of this bundle's content has been moved to a separate library | ||
at https://github.com/rollerworks/PasswordStrengthValidator. | ||
|
||
You will need to update your class imports to point to the component's | ||
namespace. | ||
|
||
All deprecated code has been removed. And support for Symfony 2 and anything | ||
lower then PHP 5.6 was dropped. Official support for HHVM is also dropped. | ||
|
||
You need at least Symfony 3.3 and PHP 5.6 (or PHP 7.0). | ||
|
||
Constraints | ||
----------- | ||
|
||
The constraints have been moved to a separate library. | ||
Update your imports to point to the new namespace. | ||
|
||
Before: | ||
|
||
```php | ||
use Rollerworks\Bundle\PasswordStrengthBundle\Validator\Constraints as RollerworksPassword; | ||
``` | ||
|
||
After: | ||
|
||
```php | ||
use Rollerworks\Component\PasswordStrength\Validator\Constraints as RollerworksPassword; | ||
``` | ||
|
||
ChainLoader | ||
----------- | ||
|
||
A new `LazyChainLoader` has been added in the library, it is are recommended | ||
to use this loader instead of the old `ChainLoader`. | ||
|
||
To enable this loader update your configuration as follow. | ||
|
||
Before: | ||
|
||
```yaml | ||
rollerworks_password_strength: | ||
blacklist: | ||
default_provider: rollerworks_password_strength.blacklist.provider.sqlite | ||
providers: | ||
chain: | ||
providers: | ||
- rollerworks_password_strength.blacklist.provider.array | ||
- rollerworks_password_strength.blacklist.provider.sqlite | ||
``` | ||
After: | ||
```yaml | ||
rollerworks_password_strength: | ||
blacklist: | ||
default_provider: rollerworks_password_strength.blacklist.provider.sqlite | ||
providers: | ||
chain: | ||
lazy: true | ||
providers: | ||
- rollerworks_password_strength.blacklist.provider.array | ||
- rollerworks_password_strength.blacklist.provider.sqlite | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.