Lambda authorizer for AWS API Gateway written in Ruby.
- Configure the API Gateway to use this Lambda function as the authorizer.
- Populate the database as below.
tokenis the string provide as:- query string
?token= - HTTP header
Authorization:
- query string
pathis a combination of API Gateway ID and route (prefixed by '/')methodsif specified, dictates what is allowed; user lowercasevalidunless true will deniedvalid_fromtimestamp, if specified, will be allowed thereaftervalid_untiltimestamp, if specified, will be allowed until thencontextwill be passed as is
{
"token": "abcd1234efgh5678", // primary key
"path": "<API_GW_ID><ROUTE>", // sort key
"desc": "Admin to internal app",
"methods": ["get", "post"],
"valid": true,
"valid_from": 1609459200,
"valid_until": 1612137600,
"context": {
"id": "123456",
"name": "User A",
"isAdmin": true
}
}