npm-registry-client
Advanced tools
Comparing version 3.1.6 to 3.1.7
@@ -45,3 +45,3 @@ var assert = require("assert") | ||
, isUserChange = where.match(adduserChange) | ||
, adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)/ | ||
, adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)$/ | ||
, isNewUser = where.match(adduserNew) | ||
@@ -81,12 +81,21 @@ , alwaysAuth = this.conf.get("always-auth") | ||
// most of the time we don't want to auth | ||
var authed = false | ||
var authed | ||
// new users can *not* use auth, because they don't *have* auth yet | ||
if (isNewUser) { | ||
this.log.verbose("request", "new user, so can't send auth") | ||
authed = false | ||
} | ||
else if (alwaysAuth || isWrite) { | ||
else if (alwaysAuth) { | ||
this.log.verbose("request", "always-auth set; sending authorization") | ||
authed = true | ||
} | ||
if (!authed) this.log.verbose("request", "no auth needed") | ||
else if (isWrite) { | ||
this.log.verbose("request", "sending authorization for write operation") | ||
authed = true | ||
} | ||
else { | ||
// most of the time we don't want to auth | ||
this.log.verbose("request", "no auth needed") | ||
authed = false | ||
} | ||
@@ -93,0 +102,0 @@ var self = this |
@@ -5,3 +5,3 @@ { | ||
"description": "Client for the npm registry", | ||
"version": "3.1.6", | ||
"version": "3.1.7", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "git://github.com/isaacs/npm-registry-client" |
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
255047
243740
2435