mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
fixing config file handling
This commit is contained in:
parent
e351559dd2
commit
2ee792633c
2 changed files with 9 additions and 2 deletions
|
@ -82,6 +82,13 @@ function Config(config) {
|
||||||
typeof(this.packages[i]) === 'object' &&
|
typeof(this.packages[i]) === 'object' &&
|
||||||
!Array.isArray(this.packages[i])
|
!Array.isArray(this.packages[i])
|
||||||
, 'CONFIG: bad "'+i+'" package description (object expected)');
|
, '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], 'access');
|
||||||
check_userlist(i, this.packages[i], 'proxy');
|
check_userlist(i, this.packages[i], 'proxy');
|
||||||
check_userlist(i, this.packages[i], 'publish');
|
check_userlist(i, this.packages[i], 'publish');
|
||||||
|
|
|
@ -24,7 +24,7 @@ Storage.prototype.add_package = function(name, metadata, callback) {
|
||||||
|
|
||||||
var uplinks = [];
|
var uplinks = [];
|
||||||
for (var i in this.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]);
|
uplinks.push(this.uplinks[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ Storage.prototype.get_package = function(name, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var uplinks = [this.local];
|
var uplinks = [this.local];
|
||||||
for (var i in this.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]);
|
uplinks.push(this.uplinks[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue