Metadata-Version: 2.1
Name: Firetail-Lambda
Version: 0.1.4
Summary: Firetail Lambda Package
Home-page: https://github.com/firetail-io/firetail-py-lambda
Author: Riley Priddle
Author-email: riley@firetail.io
License: LGPLv3
Project-URL: Documentation, https://github.com/firetail-io/firetail-py-lambda
Project-URL: Bug Reports, https://github.com/firetail-io/firetail-py-lambda/issues
Project-URL: Source Code, https://github.com/firetail-io/firetail-py-lambda
Keywords: pypi,package
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# Firetail Python Lambda Middleware

[![PyPI package](https://img.shields.io/badge/pip%20install-firetail--lambda-brightgreen)](https://pypi.org/project/firetail-lambda/) [![version number](https://img.shields.io/pypi/v/firetail-lambda?color=green&label=version)](https://github.com/Firetail-io/firetail-py-lambda/releases) [![Actions Status](https://github.com/Firetail-io/firetail-py-lambda/workflows/Test/badge.svg)](https://github.com/Firetail-io/firetail-py-lambda/actions) [![License: LGPL v3](https://img.shields.io/badge/License-LGPL_v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) [![codecov](https://codecov.io/gh/FireTail-io/firetail-py-lambda/branch/main/graph/badge.svg?token=HU206RRZZ4)](https://codecov.io/gh/FireTail-io/firetail-py-lambda)

###Overview

The purpose of this module is to correctly log out the AWS Lambda event and response payload to allow the firetail extension to then send it on to the firetail logging api

The firetail_handler is a decorator that wraps around an event handler function in a AWS Lambda to extract the event and response payloads into a base64 logging message. 

###Supported Lambda Runtimes
- [x] Python 3.7
- [x] Python 3.8
- [x] Python 3.9

###Installation
Install the module with using pip
```bash
pip install -U firetail-lambda
```



Implementing Middleware in lambda function
```python
from firetail_lambda import firetail_handler

@firetail_handler()
def lambda_handler(event, context):
    return {
        "statusCode": 200,
        "body": json.dumps({
            "message": "Hello"
        })
    }
```
Multiple Event handlers
```python
from firetail_lambda import firetail_handler

@firetail_handler()
def lambda_handler(event, context):
    return {
        "statusCode": 200,
        "body": json.dumps({
            "message": "Hello"
        })
    }

@firetail_handler()
def lambda_handler_2(event, context):
    return {
        "statusCode": 200,
        "body": json.dumps({
            "message": "Hello 2"
        })
    }
```

