Catalog npm
PACKAGE EXPLORERView in registry

3scale-lambda

npm

Generate an AWS Lambda function to authorize API calls using 3scale

Versions collected4
Direct dependencies3From release 1.0.3
Last observed20 Oct, 19:52 UTC

README

Current package documentation

3scale Lambda generator

This module generates a Lambda function to integrate the AWS API Gateway with 3scale. Authentication will be required as a user_key query parameter.

Prerequisites

Create the following Mapping Template in your AWS API Gateway endpoint:

{
  "user_key": "$input.params('user_key')",
  "resourcePath": "$context.resourcePath",
  "httpMethod": "$context.httpMethod",
  "body": "$input.json('$')"
}

The Content-Type of the mapping template should be application/json.

Method names

For each API endpoint you should create the corresponding method in 3scale. That way you will be able to keep track of the aggregate usage of your API as well as the breakdown per endpoint.

It is important that you create the method names in 3scale following this pattern:

  • Endpoint HTTP method: GET
  • Endpoint path: /api/words
  • 3scale method name: api_words_GET

Using it programatically

var generator = require('3scale-lambda');
var params = {
  providerKey: '3SCALE_PROVIDER_KEY',
  serviceId: '3SCALE_SERVICE_ID'
};
generator(params, '/output/path/');

This will create a zip file at /output/path/3scale-lambda-auth.zip. That zip is the bundle containing the Lambda function and all its dependencies, ready to be uploaded to AWS.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 4

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.3Registry latest12 Oct 20153
1.0.216 Sept 20153
1.0.030 Aug 20153
0.0.113 Aug 20153

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:52 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ea2b7b039749deb63befafd458a94431ed3f0bddb989091fd7f8740316eefa99