Skip to main content

Simple AWS Lambda proxy to handle API Gateway request

Project description

https://badge.fury.io/py/lambda-proxy.svg https://circleci.com/gh/vincentsarago/lambda-proxy.svg?style=svg https://codecov.io/gh/vincentsarago/lambda-proxy/branch/master/graph/badge.svg

A simple AWS Lambda proxy to handle API Gateway request

Install

$ pip install -U pip
$ pip install lambda-proxy

Or install from source:

$ git clone https://github.com/vincentsarag/lambda-proxy.git
$ cd lambda-proxy
$ pip install -U pip
$ pip install -e .

Usage

With GET request

>>> from lambda_proxy.proxy import API
>>> APP = API(app_name="app")

>>> @APP.route('/test/tests/<id>', methods=['GET'], cors=True)
>>> def print_id(id):
        return ('OK', 'plain/text', id))

With POST request

>>> from lambda_proxy.proxy import API
>>> APP = API(app_name="app")

>>> @APP.route('/test/tests/<id>', methods=['POST'], cors=True)
>>> def print_id(id, body):
        return ('OK', 'plain/text', id))

Simple Auth token

Lambda-proxy provide a simple token validation system.

  • a “TOKEN” variable must be set in the environment

  • each request must provide a “access_token” params (e.g curl http://myurl/test/tests/myid?access_token=blabla)

>>> from lambda_proxy.proxy import API
>>> APP = API(app_name="app")

>>> @APP.route('/test/tests/<id>', methods=['GET'], cors=True, token=True)
>>> def print_id(id):
        return ('OK', 'plain/text', id))

License

See LICENSE.txt.

Authors

See AUTHORS.txt.

Changes

See CHANGES.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lambda_proxy-1.0.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page