EkaCare Webhook SDK
SDK for processing EkaCare webhook events
Overview
The EkaCare Webhook SDK enables secure processing of webhook events from EkaCare. It validates webhook signatures, manages sensitive data, and ensures only authorized requests are processed.
Deployment is automated using the deploy.sh script, which performs the following steps:
- Creates an ECR repository, builds the Docker image using the Dockerfile, and pushes it to ECR.
- Uses AWS CloudFormation to provision all required resources, including:
- A Lambda function (using the Docker image) with a new IAM role.
- VPC attachment for the Lambda function.
- A REST API Gateway for the Lambda, with a custom domain name (as specified in
config.env
). - A Route 53 DNS entry pointing to the API Gateway for the custom domain.
- Registers the webhook endpoint with EkaCare using the provided URL.
This setup ensures a secure, scalable, and automated deployment of the webhook handler in your AWS environment.
Environment Variables
Set the following environment variables for proper application functionality:
Mandatory Variables
CLIENT_ID
: Your client ID for authentication (required)CLIENT_SECRET
: Your client secret for authentication (required)
Conditional Variables
SIGNING_KEY
:
- Required when
IS_SIGNING_KEY_IMPLEMENTED
is set toTrue
inconstants.py
- Used for verifying webhook signatures
API_KEY
:
- Required for business use cases
- Used for making authorized API calls to EkaCare services
Configuration
To disable signature verification, set IS_SIGNING_KEY_IMPLEMENTED = False
in the constants.py
file.
Ensure all required environment variables are set before deploying or running the application.
Example: constants.py
Sample: https://github.com/eka-care/ekapython-webhook-sdk/blob/main/constants.py
Signature Verification
- Set
IS_SIGNING_KEY_IMPLEMENTED
inconstants.py
: True
: Enable signature verification (recommended for production)False
: Disable signature verification (use only for testing)
How to Deploy eka-webhook Python Lambda in an AWS Environment
Repository: https://github.com/eka-care/ekapython-webhook-sdk
Prerequisites
- AWS CLI installed and configured
curl
andunzip
installed- Docker installed and running
- AWS credentials and permissions for deploying resources (API Gateway, CloudFormation, Lambda, ECR, etc.)
Resources Created
- ECR repository
- Lambda function (Docker image)
- API Gateway
- Custom domain name
- Route 53 entry
- IAM role
- Security group (optional)
Step-by-Step Setup
- Fork and Clone the Project
- Configure AWS Credentials
Or export your AWS credentials
if using IAM Identity Center.
- Configure Environment Variables
Edit the
config.env
file with the necessary configuration values.
Sample: https://github.com/eka-care/ekapython-webhook-sdk/blob/main/config.env
For more details, refer to detailed.md.
- Make the Deployment Script Executable
Deployment Commands
Deploy:
Delete:
Upgrade:
Help: