express-brute-pg
Advanced tools
Comparing version 1.0.0 to 1.0.1
12
index.js
@@ -17,5 +17,13 @@ var AbstractClientStore = require('express-brute/lib/AbstractClientStore'), | ||
PgStore.prototype.connect = function (callback) { | ||
var password = encodeURIComponent(this.options.password); | ||
var string; | ||
this.pg.connect('postgres://' + this.options.username + ':' + password + '@' + this.options.host + '/' + this.options.database, callback); | ||
if (this.options.hasOwnProperty('password')) { | ||
var password = encodeURIComponent(this.options.password); | ||
string = util.format('postgres://%s:%s@%s/%s', this.options.username, password, this.options.host, this.options.database); | ||
} else { | ||
string = util.format('postgres://%s@%s/%s', this.options.username, this.options.host, this.options.database); | ||
} | ||
this.pg.connect(string, callback); | ||
}; | ||
@@ -22,0 +30,0 @@ |
{ | ||
"name": "express-brute-pg", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A PostgreSQL store for express-brute", | ||
@@ -22,2 +22,5 @@ "keywords": [ | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"devDependencies": { | ||
@@ -24,0 +27,0 @@ "chai": "^3.3.0", |
express-brute-pg | ||
=================== | ||
[![Build Status](https://travis-ci.org/dmfay/express-brute-pg.svg?branch=master)](https://travis-ci.org/dmfay/express-brute-pg) | ||
A PostgreSQL store for [express-brute](https://github.com/AdamPflug/express-brute) via [node-postgres](https://github.com/brianc/node-postgres). | ||
@@ -44,5 +46,5 @@ | ||
- `username` Database username | ||
- `password` Corresponding password | ||
- `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` | ||
- `pg` You may pass in your application's `pg` module 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 |
@@ -9,5 +9,4 @@ var assert = require('chai').assert; | ||
instance = new PgStore({ | ||
database: 'sandbox', | ||
username: 'appuser', | ||
password: 'password' | ||
database: 'brute_pg', | ||
username: 'postgres' | ||
}); | ||
@@ -14,0 +13,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11286
7
198
50