Skip to content

Instantly share code, notes, and snippets.

View sufw's full-sized avatar

Sascha Wenninger sufw

View GitHub Profile
@JensWalter
JensWalter / authorizer.js
Last active November 9, 2022 14:03
Resolves the key name through a custom authorizer and maps the actual name into the lambda context.
const AWS = require("aws-sdk");
const APIGATEWAY = new AWS.APIGateway();
exports.handler = async (event, context) => {
var apiKey = event.authorizationToken;
//open arn for the whole API including all methods
let arn = event.methodArn.replace(/\/prod\/.*/,'/prod/*/*')
let keyname = 'unknown';