New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

3scale-lambda

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

3scale-lambda

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

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 12 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc