diff --git a/lib/config.js b/lib/config.js index 03e6f1caa..344d202db 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,5 +1,6 @@ var assert = require('assert'); var crypto = require('crypto'); +var minimatch = require('minimatch'); // [[a, [b, c]], d] -> [a, b, c, d] function flatten(array) { @@ -91,13 +92,7 @@ function Config(config) { function allow_action(package, who, action) { for (var i in this.packages) { - var match_package = i == package; - var m = i.match(/^\/(.*)\/$/); - if (m && (new RegExp(m[1])).exec(package)) { - match_package = true; - } - - if (match_package) { + if (minimatch.makeRe(i).exec(package)) { return this.packages[i][action].reduce(function(prev, curr) { if (curr === who || curr === 'all') return true; return prev; diff --git a/lib/config_def.yaml b/lib/config_def.yaml index b47e0ec17..76430704b 100644 --- a/lib/config_def.yaml +++ b/lib/config_def.yaml @@ -11,7 +11,7 @@ uplinks: url: https://registry.npmjs.org/ packages: - '/.*/': + '*': publish: admin access: all proxy: npmjs diff --git a/package.yaml b/package.yaml index cdb6426c2..3ae643f8b 100644 --- a/package.yaml +++ b/package.yaml @@ -24,6 +24,7 @@ dependencies: request: '*' async: '*' semver: '*' + minimatch: '*' keywords: # TODO - private