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

npm-registry-client

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-registry-client - npm Package Compare versions

Comparing version 0.0.11 to 0.1.0

40

lib/adduser.js

@@ -42,5 +42,27 @@

cb = done.call(this, cb)
// pluck off any other username/password/token. it needs to be the
// same as the user we're becoming now. replace them on error.
var pre = { username: this.username
, password: this.password
, auth: this.auth
, token: this.token }
this.log.verbose("adduser", "before first PUT", userobj)
this.token = null
this.couchLogin.token = null
this.username = username
this.password = password
this.auth = new Buffer(username + ':' + password).toString('base64')
cb = done.call(this, cb, pre)
var logObj = Object.keys(userobj).map(function (k) {
if (k === 'salt' || k === 'password_sha') return [k, 'XXXXX']
return [k, userobj[k]]
}).reduce(function (s, kv) {
s[kv[0]] = kv[1]
return s
}, {})
this.log.verbose("adduser", "before first PUT", logObj)
this.request('PUT'

@@ -75,3 +97,3 @@ , '/-/user/org.couchdb.user:'+encodeURIComponent(username)

})
this.log.verbose("adduser", "userobj", userobj)
this.log.verbose("adduser", "userobj", logObj)
this.request('PUT'

@@ -86,3 +108,3 @@ , '/-/user/org.couchdb.user:'+encodeURIComponent(username)

function done (cb) {
function done (cb, pre) {
return function (error, data, json, response) {

@@ -92,2 +114,12 @@ if (!error && (!response || response.statusCode === 201)) {

}
// there was some kind of error, re-instate previous auth/token/etc.
this.couchLogin.token = this.token = pre.token
if (this.couchLogin.tokenSet) {
this.couchLogin.tokenSet(pre.token)
}
this.username = pre.username
this.password = pre.password
this.auth = pre.auth
this.log.verbose("adduser", "back", [error, data, json])

@@ -94,0 +126,0 @@ if (!error) {

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Client for the npm registry",
"version": "0.0.11",
"version": "0.1.0",
"repository": {

@@ -8,0 +8,0 @@ "url": "git://github.com/isaacs/npm-registry-client"

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