nstcactus/yii2-pwned-validator
Composer 安装命令:
composer require nstcactus/yii2-pwned-validator
包简介
A Yii2 password validator against the HIBP pwned passwords API
README 文档
README
A Yii2 password validator against the Pwned passwords database.
Pwned Passwords are more than half a billion real world passwords previously exposed in data breaches. This exposure makes them unsuitable for ongoing use as they're at much greater risk of being used to take over other accounts.
Requirements
- Yii framework 2
- PHP
mbstring(multibyte string) extension (required)
Installation
The preferred way to install this extension is through Composer.
To install, either run
$ composer require nstcactus/yii2-pwned-validator
or add
"nstcactus/yii2-pwned-validator": "*"
to the require section of your composer.json file.
Usage
Model class example:
<?php namespace app\models; use nstCactus\yii2\validators\PwnedValidator; use Yii; use yii\base\Model; class YourCustomModel extends Model { public function rules() { return [ ['newPassword', PwnedValidator::class], ]; } public function attributeLabels() { return [ 'newPassword' => Yii::t('app', 'New password'), ]; } }
This validator will fail to validate passwords that have been exposed in known security breaches.
Like it?
Send some love to Troy Hunt, the author of Have I been pwned?.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-23