@adneovrebo/api-gateway-apikey-query-authorizer
v1.0.1
Published
A package to authorize AWS Gateway API with API-key as query parameter.
Downloads
14
Readme
AWS API-Gateway API-key query
Function for allowing to pass API-Gateway generated api-keys as queryparameter. Allows for some edge-case usage.
This allows for the following usage with AWS API-key managing:
https://some-url/prod/transaction?apikey=some-api-keyLambda setup
# Install dependency in lambda function
npm i @adneovrebo/api-gateway-apikey-query-authorizer// In your authorizer lambda function add the following
import apiKeyQueryAuthorizer from '@adneovrebo/api-gateway-apikey-query-authorizer';
exports.handler = apiKeyQueryAuthorizer;# ZIP content and deploy lambda function with aws-cli (or any other way you like)
zip -r authorizer.zip . && aws lambda update-function-code --function-name <FunctionName> --zip-file fileb://authorizer.zipConfigure API-gateway
Create authorizer with the deployed lambda function

Go to settings and select
API Key Sourceto beAUTHORIZEROn the selected request select the authorizer and set
API Key Requiredtotrue
Deploy API for changes to take effect.
Create usage plans and API keys to the desired API.
Happy coding 🎉
