Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

3scale-lambda

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

Published30 Aug 2015
Direct dependencies3
Transitive dependenciesNot calculated

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.

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
archiver
Environment
{
  "local_name": "archiver",
  "alias": false,
  "peer_metadata": null
}
^0.14.4runtime
split
Environment
{
  "local_name": "split",
  "alias": false,
  "peer_metadata": null
}
^1.0.0runtime
through
Environment
{
  "local_name": "through",
  "alias": false,
  "peer_metadata": null
}
^2.3.8runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "362196a7de43ac2e1b475a708751bbf870b0f31a",
  "tarball": "https://registry.npmjs.org/3scale-lambda/-/3scale-lambda-1.0.0.tgz",
  "integrity": "sha512-yJDJ7M+ZcRZ0HWezGipX6NSUWETRz8v1z+EJevOakr64rJ45Kp63OnFmGY39+NUKrc2RcUSB2Uxyu2ftSIV18g==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIAgZ04ru1eYg1T343fB/cKhbzwm1LHpcllbCTFfVuTCMAiAda49B7s9z5Qd96A9PzAKBlNSCPrYfxSVS7/clqlu2gg=="
    }
  ]
}

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_version:c03b043631ea1ce2fec298bd7461c7cf9ecdc3f550cacd5c981e8ed1dd2b6256

Other collected versions

1.0.312 Oct1.0.216 Sept0.0.113 AugView all collected versions →