Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-brute-pg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-brute-pg

A PostgreSQL store for express-brute

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

express-brute-pg

Build Status

A PostgreSQL store for express-brute via node-postgres.

Installation

via npm:

$ npm install express-brute-pg

express-brute-pg expects a table named brute (this may be overridden in the constructor) to exist in whatever database you're connecting to.

create table brute(id text primary key, count int, first_request timestamptz, last_request timestamptz, expires timestamptz);

Usage

var ExpressBrute = require('express-brute'),
	PgStore = require('express-brute-pg');

var store = new PgStore({
	host: '127.0.0.1',
	database: 'sandbox',
	username: 'appuser',
	password: 'password'
});

var bruteforce = new ExpressBrute(store);

app.post('/auth',
	bruteforce.prevent, // error 403 if we hit this route too often
	function (req, res, next) {
		res.send('Success!');
	}
);

Options

  • host Postgres server host name or IP address
  • database Database name to connect to
  • username Database username
  • password Corresponding password, if password authentication is required
  • tableName Include to use a storage table named something other than brute
  • schemaName Include if your storage table is in a schema other than public
  • pool You may pass in your application's pool instance to express-brute-pg to share connection pools or use the native bindings; if not supplied, express-brute-pg will spin up its own pool

Keywords

FAQs

Package last updated on 05 Feb 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc