Files
AutoGPT/autogpt_platform/autogpt_libs
Nicholas Tindle af8ea93260 feat(backend): handle bounced emails from postmark (#9506)
<!-- Clearly explain the need for these changes: -->
If we bounce too many emails from Postmark, they will be really upset
with us, which is not so good. We need a way to react when we bounce
emails, so we set it up so they notify us via webhooks.

We also need to build authentication into those webhooks to prevent
random people from sending us fake webhooks.

All this together means we need a new route for the inbound webhook.

To do this, we need a way to track if the email address is valid. So,
after chatting with @itsababseh, we are adding a validated email field
that defaults to `True` because all the users are already validated in
prod. In dev, we may suffer.

### Changes 🏗️

<!-- Concisely describe all of the changes made in this pull request:
-->
- Adds special API Key auth handler to the libs so that we can easily
test stuff on the /docs endpoint and re-use it if needed
- Adds New Secret for this API key from postmark
- Adds a validatedEmail boolean to the`User` table
- Adds a postmark endpoint to the routers list for handling the inbound
webhook from Postmark
- "Handle" all the various things this endpoint could send us (most of
them we do nothing about)

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
- [x] Sign up with john@example.com email (the one postmark uses in
webhooks)
  - [x] Set email validation to true
  - [x] Send the bounce webhook notice
  - [x] Check it gets set to false

#### For configuration changes:
- [x] `.env.example` is updated or already compatible with my changes
- [x] `docker-compose.yml` is updated or already compatible with my
changes
- [x] I have included a list of my configuration changes in the PR
description (under **Changes**)
2025-02-25 20:59:41 +00:00
..

AutoGPT Libs

This is a new project to store shared functionality across different services in NextGen AutoGPT (e.g. authentication)