Skip to content

Instantly share code, notes, and snippets.

@dsandor
Created February 26, 2020 14:44
Show Gist options
  • Select an option

  • Save dsandor/26e66dff30d82e6f1a71b4bafcbc0a79 to your computer and use it in GitHub Desktop.

Select an option

Save dsandor/26e66dff30d82e6f1a71b4bafcbc0a79 to your computer and use it in GitHub Desktop.
exports.authorizerHandler = async (event, context, callback) => {
if (event.headers['Authorization'] && event.headers['Authorization'] !== 'fail') {
callback(null, generatePolicy('user', 'Allow', event.methodArn));
} else {
callback(null, generatePolicy('user', 'Deny', event.methodArn));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment