Skip to content

Security

Pieter Hordijk edited this page Jan 1, 2019 · 2 revisions

TOC

NotPwnedPassword

Validates the input (string) against the list of pwned passwords of the HIBP service. If the number of hits exceeds the threshold (int)this validator will fail.

Version information

Available since: 1.0.0

Usage

<?php declare(strict_types);

use HarmonyIO\Validation\Rule\Security\NotPwnedPassword;

(new NotPwnedPassword(6))->validate('password');

Failure reasons

  • Type.String when the validated value is not a string
  • Security.NotPwnedPassword when the validated value has been mentioned in the HIBP database more than threshold number of times
Clone this wiki locally