ritey/password-strength 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ritey/password-strength

Composer 安装命令:

composer require ritey/password-strength

包简介

This package provides a validator for ensuring strong passwords in Laravel 6 applications.

README 文档

README

Build Status Total Downloads License

This package provides a validator that ensures strong passwords in Laravel 4 & 5 applications. It is influenced a lot by PasswordStrengthBundle for Symfony 2.

It is out now for a while and since there were no complaints it very likely fulfills its purpose.

The provided validations include:

  • check if input contains alphabetic characters
  • check if input contains numeric characters
  • check if input contains mixed case characters
  • check if input contains symbols

Documentation

Installation

Get the package

For Laravel 4 users

Just composer require schuppo/password-strength:"~0.10".

For Laravel 5 users

Just composer require schuppo/password-strength:"~1.5".

Initialize the package

If you do run the package on Laravel 5.5+, you can start using the package at this point. package auto-discovery takes care of the magic of adding the service provider.

If you do not run Laravel 5.5 (or higher), then add the following line under the providers array key in app/config.php:

// app/config/app.php
return array(
    // ...
    'providers' => array(
        // ...
        \Schuppo\PasswordStrength\PasswordStrengthServiceProvider::class,
    );
    // ...
);

Caution

I recently recognized a small conflict in the usage of this package in combination with unique-with: One runs into problems when adding the PasswordStrengthServiceProvider after UniqueWithValidatorServiceProvider to the providers array, the rules of this package stay unknown to the Laravel Validator.

The problem is easy to fix though: Just add the service provider of this package in front of the service provider of unique-with. In that order both packages work fine.

Usage

Now Laravel's native Validator is extended by four rules:

  • case_diff
  • numbers
  • letters
  • symbols

Example

You can apply these rules as described in the validation section on Laravel's website

$v = Validator::make(array(
    'password' => '12345QWERTqwert@',
    'password' => 'case_diff|numbers|letters|symbols'
));
$v->passes();   // returns true;

Notice that you can validate any value with the new rules. The only reason why this package is called "Password Strength Package" is that it describes its foremost purpose.

History

[Laravel 5 / Laravel 4]

[1.11/-]

Simplifies symbol validation

[1.10/0.15]

Adds Chinese and Spanish translation

[1.9/0.14]

Improves Polish translation

[1.8/0.13]

Adds Arabic translation

[1.7/0.12]

Adds Czech translation

[1.6/0.11]

  • Adds Russian translation

[1.5/0.10]

  • Adds unicode flag to case difference validation rule

[1.4/0.9]

  • Adds Dutch translation
  • Updates French translation
  • Makes packages php7 ready

[1.3/0.8.2]

Adds Romanian translation

[1.2/0.8.1]

Adds Polish translation

[1.1/0.8]

Adds French translation

[1.0.2/0.7]

Updates README.md

[1.0.1]

Make package laravel 5 ready

[0.6]

  • New validation rule to check if input contains symbols. Thanks to closca for providing this new feature.

[0.5.3]

  • Added new version to composer.json

[0.5.2]

  • Small changes in README.md

[0.5.1]

  • Minimum requirement (PHP 5.4 because of array chains) is now recognized by composer.json

[0.4.1]

  • The package works properly now when other extensions of laravel's validator are used as well (like unique-with).
  • The package is able to take localization overwrites now as described in the laravel docs

[0.3.1]

  • Fixed: Package validator doesn't overwrite custom validation errror messages any more. Not functional tested though because I have no clue how to set up a test which controls the passing of variables from the password strength package to the native validator INSIDE the package's test folders. Any suggestions?

License

This package is under the MIT license. See the complete license:

Reporting Issues or Feature Requests

Issues and feature requests are tracked on GitHub.

ritey/password-strength 适用场景与选型建议

ritey/password-strength 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.64k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 11 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「validation」 「password」 「laravel」 「password strength」 「laravel 6」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ritey/password-strength 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ritey/password-strength 我们能提供哪些服务?
定制开发 / 二次开发

基于 ritey/password-strength 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 11.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 54
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-06