aws-apigw-authorizer
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -92,3 +92,3 @@ "use strict"; | ||
exports.ApiGatewayAuthorizer = ApiGatewayAuthorizer; | ||
function defaultBuildPolicy(event, principalId, _decodedToken) { | ||
function defaultBuildPolicy(event, principal, _decodedToken) { | ||
// this function must generate a policy that is associated with the recognized principal user identifier. | ||
@@ -122,9 +122,9 @@ // depending on your use case, you might store policies in a DB, or generate them on the fly | ||
// otherwise it would be denied | ||
const policy = new awsPolicyLib.AuthPolicy(principalId, awsAccountId, apiOptions); | ||
const policy = new awsPolicyLib.AuthPolicy(principal, awsAccountId, apiOptions); | ||
policy.allowMethodWithConditions(awsPolicyLib.AuthPolicy.HttpVerb.ALL, '/*', conditions); | ||
return policy.build(); | ||
} | ||
function defaultBuildContext(_event, principalId, _decodedToken) { | ||
return { principalId }; | ||
function defaultBuildContext(_event, principal, _decodedToken) { | ||
return { principal }; | ||
} | ||
//# sourceMappingURL=authorizer.js.map |
{ | ||
"name": "aws-apigw-authorizer", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "AWS Lambda Authorizer for API Gateway", | ||
@@ -5,0 +5,0 @@ "main": "lib/authorizer.js", |
27397