2017 © Pedro Peláez
 

library haveibeenpwned

Client for the "Have I Been Pwned" API

image

xsist10/haveibeenpwned

Client for the "Have I Been Pwned" API

  • Monday, June 18, 2018
  • by xsist10
  • Repository
  • 1 Watchers
  • 11 Stars
  • 304 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 10 Versions
  • 12 % Grown

The README.md

HaveIBeenPwned PHP client

Build Status, (*1)

Install

``` json { "require": { "xsist10/haveibeenpwned": "~1.0" } }, (*2)


## Usage ### Create manager instance ``` php use xsist10\HaveIBeenPwned\HaveIBeenPwned; use xsist10\HaveIBeenPwned\Adapter\Curl; use xsist10\HaveIBeenPwned\Adapter\FileGetContents; // By default the $manager will use a Curl adapter $manager = new HaveIBeenPwned(); // You can create a new manager with a specified adapter $manager = new HaveIBeenPwned(new Curl()); // You can also set the adapter after creation $manager->setAdapter(new FileGetContents());

Check if you've been pwned

``` php $manager->checkAccount("your_email_address");, (*3)


### Check if your account has been leaked in a paste ``` php $manager->getPasteAccount("your_email_address");

Check if your password has been leaked before

``` php // Your password is not sent to the remote API. Only a partial of the SHA1 // value is sent and all matching full SHA1 results are returned and compared. $numberOfTimesCompromised = $manager->isPasswordCompromised("your_password");, (*4)


### List all breaches that have are on record ``` php $manager->getBreaches(); $manager->getBreach('specific_breach_by_name');

List the types of data that are covered when describing a leak

``` php $manager->getDataClasses();, (*5)


## Logger Support The adapters support [PSR-3 Logger](http://www.php-fig.org/psr/psr-3/). I recommend using [monolog](https://github.com/Seldaek/monolog). ### Install Monolog ```bash $ composer require monolog/monolog

Use Monolog with HaveIBeenPwned

use xsist10\HaveIBeenPwned\HaveIBeenPwned;
use xsist10\HaveIBeenPwned\Adapter\Curl;

use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$log = new Logger('name');
// Push all logging up to the level of DEBUG to our log file
$log->pushHandler(new StreamHandler('[full log filename]', Logger::DEBUG));

$adapter = new Curl();
$adapter->setLogger($log);
$manager = new HaveIBeenPwned($adapter);

// Calls made to HaveIBeenPwned will be logged to your log file now

Credits

License

The MIT License (MIT). Please see License File for more information., (*6)

The Versions

18/06 2018

dev-master

9999999-dev

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

 

The Development Requires

27/02 2018

1.2.0

1.2.0.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

 

The Development Requires

27/02 2018

dev-password_pwned

dev-password_pwned

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

 

The Development Requires

29/07 2017

1.1.1

1.1.1.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

 

The Development Requires

29/07 2017

1.1.0

1.1.0.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

 

The Development Requires

16/07 2017

1.0.4

1.0.4.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

30/06 2017

1.0.3

1.0.3.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

11/08 2014

1.0.2

1.0.2.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

06/07 2014

1.0.1

1.0.1.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

21/06 2014

1.0.0

1.0.0.0

Client for the "Have I Been Pwned" API

  Sources   Download

MIT