🟡 Pleno — Receptor de webhooks com validação HMAC-SHA256 e log de eventos
sequenceDiagram
participant G as GitHub
participant A as API
participant DB as Eventos (mem)
G->>A: POST /webhook/github + X-Hub-Signature-256
A->>A: HMAC-SHA256 verify
alt Inválido
A-->>G: 401 Unauthorized
else Válido
A->>DB: Salvar evento
A-->>G: 200 OK
end
A-->>Client: GET /eventos
- Python 3.11+
- FastAPI
- hmac (stdlib)
pip install -r requirements.txt
uvicorn main:app --reload
# Docs: http://localhost:8000/docswebhook-handler-py/
├── main.py
└── requirements.txt