/zxcvbn-api

Web API wrapper to Dropbox's zxcvbn library.

Primary LanguageJavaScript

Web API built with Node and Express. It wraps Dropbpx's zxcvbn library just in case you need to verify a password's strength on both the client and server with a guarantee of the same result from both.

Environmental config

Node.js must be installed.

Optionally, Docker and/or cURL

Initial app config

npm install

Testing

npm test

Starting app

For normal people

npm start

npm run start:dev for automatic node restart when code changes.

For studs

npm run docker:start

Available API's

POST is required for security reasons. Think of the call as a request to create a strength estimation. API assumes SSL protocol.

POST /zxcvbn

Request body

{
    "password": "horsebatterystaple"
}

Returns

zxcvbn result described here

POST /zxcvbn/score

Request body

{
    "password": "horsebatterystaple"
}

Returns

{
    "score": [0-4]
}

Testing

curl -H "Content-Type: application/json" -X POST -d '{"password":"asdfghgfd"}' http://localhost:3000/zxcvbn/score

Stopping app

Ctrl-c if started with npm start or npm run start:dev

npm run docker:stop if started with npm run docker:start

Additional resources

Docker image

Why a strength estimator?

Looking for a PHP client?