Socket
Socket
Sign inDemoInstall

express-pwnd-pw

Package Overview
Dependencies
5
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    express-pwnd-pw

Express.js (Node.js / Request) security middleware for checking user password safety with Have I Been Pwned (HIBP) API


Version published
Weekly downloads
10
decreased by-47.37%
Maintainers
1
Install size
385 kB
Created
Weekly downloads
 

Readme

Source

Build Status Quality Gate Status Open Source Helpers
npm version install size npm downloads GitHub license

express-pwnd-pw

Express.js security middleware for checking user password safety with Have I Been Pwned (HIBP) API.

INSTALL

npm i express-pwnd-pw

Or find help from:

SYNOPSIS

"use strict";
var express = require('express');
var app = express();
var pwndPw = require('express-pwnd-pw');

app.use(pwndPw());	// use default settings

app.post('/foo', function (req, res) {
	if (Object.keys(req.pwndPw) > 0) {
		// It's a popular password! (rock)
	}
	res.send('Hello World!');
});

app.get('/bar', function (req, res) {
	// ...
	let vuln = pwndPw.password('12345');
	if (Object.keys(vuln) > 0) {
		// It's a popular password! (rock)
	}
})

app.listen(3000);

Middleware

"use strict";
var express = require('express');
var app = express();
var pwndPw = require('express-pwnd-pw');

app.use(pwndPw());	// use default settings

app.post('/foo', function (req, res) {
	if (Object.keys(req.pwndPw) > 0) {
		// It's a popular password! (rock)
		// { '8cb2237d0679ca88db6464eac60da96345513964': 2333232 }
	}
	res.send('Hello World!');
});

app.listen(3000);

Helper Functions

password()

var pwndPw = require('express-pwnd-pw');

let vuln = pwndPw.password(['12345', '67890']);
if (Object.keys(vuln) > 0) {
	// It's a popular password! (rock)
	// {
	// 	'8cb2237d0679ca88db6464eac60da96345513964': 2333232,
	// 	'230991abcd77e8173edb0af392e1f11120051e29': 6638
	// }
}

Contribute

PRs welcome!
If you use/like this module, please don't hesitate to give me a Star. I'll be happy whole day!

Hope this module can save your time, a tree, and a kitten.

Keywords

FAQs

Last updated on 15 Jul 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc