Add accesscontrol.canonicalScope tests

This commit is contained in:
Girish Ramakrishnan
2018-06-14 20:17:54 -07:00
parent 92e6909567
commit 62793ca7b3
2 changed files with 25 additions and 1 deletions

View File

@@ -117,7 +117,9 @@ function uninitialize(callback) {
}
function canonicalScope(scope) {
return scope.replace(exports.SCOPE_ANY, exports.VALID_SCOPES.join(','));
var scopes = scope.split(',');
scopes = scopes.map(function (s) { return s.replace(exports.SCOPE_ANY, exports.VALID_SCOPES.join(',')); });
return scopes.join(',');
}
function normalizeScope(allowedScope, wantedScope) {