Skip to content

lordjabez/buy-me-a-coffee-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buy Me A Coffee Webhook

This repository contains an example implementation of a Lambda function that can handle an event webhook from Buy Me A Coffee.

Currently this function only logs the received values, but can be extended to perform any number of actions upon receipt.

Note that the function URL endpoint itself is unauthenticated, but an HMAC signature check is performed to ensure the webhook call is valid.

Prerequisites

Install the requisite packages with pip3 install -r requirements.txt.

Testing

Execute utilities/run-tests.bash, which runs three items:

  • flake8 code quality check
  • bandit security vulnerability scan
  • cdk synth which includes a cdk_nag check defined in app.py
  • pytest unit tests defined in tests/test_stack.py

Deployment

  1. Configure AWS CLI credentials for the account where the solution will be deployed.
  2. Deploy the Lambda function with cdk deploy. Copy the function URL in the output.
  3. Create the webhook here, pasting in URL from step 1. Copy the secret value displayed in the console.
  4. Run utilities/create-secret.py SECRET, replacing SECRET with the copied secret from step 2.

License

This project is licensed under the MIT-0 License. See the LICENSE file for details.

About

Lambda function to handle a Buy Me A Coffee webhook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published