from-gateway
Verify that a lamba request came from the gateway
Usage
const fromGateway = require('@filevinepros/from-gateway');
const gatewayToken = process.env.GATEWAY_TOKEN;
const jwtPublicKey = process.env.PUBLIC_KEY;
const authorize = fromGateway(gatewayToken, jwtPublicKey);
const event = {
methodArn: 'arn:aws:....',
headers: {
Authorization: 'Bearer yourJwtAccessTokenString',
'x-fv-gateway-token': 'yourProvidedGatewayToken'
}
}
const context = {
}
const callback = (err, iamPolicyAndPrincipal) => {
}
authorize(event, context, callback);