0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

fixing config file handling

This commit is contained in:
Alex Kocharin 2013-09-24 10:27:27 +04:00
parent e351559dd2
commit 2ee792633c
2 changed files with 9 additions and 2 deletions

View file

@ -82,6 +82,13 @@ function Config(config) {
typeof(this.packages[i]) === 'object' &&
!Array.isArray(this.packages[i])
, 'CONFIG: bad "'+i+'" package description (object expected)');
check_userlist(i, this.packages[i], 'allow_access');
check_userlist(i, this.packages[i], 'allow_publish');
check_userlist(i, this.packages[i], 'proxy_access');
check_userlist(i, this.packages[i], 'proxy_publish');
// deprecated
check_userlist(i, this.packages[i], 'access');
check_userlist(i, this.packages[i], 'proxy');
check_userlist(i, this.packages[i], 'publish');

View file

@ -24,7 +24,7 @@ Storage.prototype.add_package = function(name, metadata, callback) {
var uplinks = [];
for (var i in this.uplinks) {
if (this.config.allow_proxy(name, i)) {
if (this.config.proxy_access(name, i)) {
uplinks.push(this.uplinks[i]);
}
}
@ -143,7 +143,7 @@ Storage.prototype.get_package = function(name, callback) {
var self = this;
var uplinks = [this.local];
for (var i in this.uplinks) {
if (this.config.allow_proxy(name, i)) {
if (this.config.proxy_access(name, i)) {
uplinks.push(this.uplinks[i]);
}
}