claudia-api-builder
Advanced tools
Comparing version 1.5.1 to 1.6.0
{ | ||
"name": "claudia-api-builder", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "Simplify AWS ApiGateway handling", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# Release history | ||
## 1.6.0, 26 August 2016 | ||
- support for custom authorizers | ||
## 1.5.1, 4 August 2016 | ||
@@ -4,0 +8,0 @@ |
@@ -11,2 +11,3 @@ /*global module, require */ | ||
unsupportedEventCallback, | ||
authorizers, | ||
interceptCallback, | ||
@@ -104,2 +105,5 @@ prompter = (components && components.prompter) || require('./ask'), | ||
} | ||
if (authorizers) { | ||
result.authorizers = authorizers; | ||
} | ||
return result; | ||
@@ -222,2 +226,17 @@ }; | ||
}; | ||
self.registerAuthorizer = function (name, config) { | ||
if (!name || typeof name !== 'string' || name.length === 0) { | ||
throw new Error('Authorizer must have a name'); | ||
} | ||
if (!config || typeof config !== 'object' || Object.keys(config).length === 0) { | ||
throw new Error('Authorizer ' + name + ' configuration is invalid'); | ||
} | ||
if (!authorizers) { | ||
authorizers = {}; | ||
} | ||
if (authorizers[name]) { | ||
throw new Error('Authorizer ' + name + ' is already defined'); | ||
} | ||
authorizers[name] = config; | ||
}; | ||
}; |
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
12599
258