Socket
Socket
Sign inDemoInstall

pg.js

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg.js - npm Package Compare versions

Comparing version 2.9.0 to 2.10.0

25

lib/client.js
var crypto = require('crypto');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var pgPass = require('pgpass');

@@ -41,2 +42,3 @@ var ConnectionParameters = require(__dirname + '/connection-parameters');

var con = this.connection;
if(this.host && this.host.indexOf('/') === 0) {

@@ -68,9 +70,24 @@ con.connect(this.host + '/.s.PGSQL.' + this.port);

function checkPgPass(cb) {
return function(msg) {
if (null !== self.password) {
cb(msg);
} else {
pgPass(self.connectionParameters, function(pass){
if (undefined !== pass) {
self.connectionParameters.password = self.password = pass;
}
cb(msg);
});
}
};
}
//password request handling
con.on('authenticationCleartextPassword', function() {
con.on('authenticationCleartextPassword', checkPgPass(function() {
con.password(self.password);
});
}));
//password request handling
con.on('authenticationMD5Password', function(msg) {
con.on('authenticationMD5Password', checkPgPass(function(msg) {
var inner = Client.md5(self.password + self.user);

@@ -80,3 +97,3 @@ var outer = Client.md5(inner + msg.salt.toString('binary'));

con.password(md5password);
});
}));

@@ -83,0 +100,0 @@ con.once('backendKeyData', function(msg) {

4

lib/connection-parameters.js

@@ -88,4 +88,6 @@ var dns = require('dns');

}
if(this.host) {
params.push("host=" + this.host);
}
if(this.isDomainSocket) {
params.push("host=" + this.host);
return cb(null, params.join(' '));

@@ -92,0 +94,0 @@ }

{
"name": "pg.js",
"version": "2.9.0",
"version": "2.10.0",
"description": "node-postgres without the bindings",

@@ -13,3 +13,4 @@ "main": "index.js",

"generic-pool": "~2.0.4",
"buffer-writer": "~1.0.0"
"buffer-writer": "~1.0.0",
"pgpass": "0.0.1"
},

@@ -16,0 +17,0 @@ "devDependencies": {

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