✨ Support event-driven rate limit updates (webhooks)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 104
Description
Problem or Use Case
External systems need to push limit changes to zae-limiter in response to events:
- Billing integration - Stripe/payment system triggers limit changes on plan upgrade/downgrade/failure
- Abuse detection - Security system reduces limits when suspicious activity detected
- Manual overrides - Admin tools trigger immediate limit changes
- Cross-system coordination - Other services notify zae-limiter of capacity changes
Currently, external systems must use the Python API directly, which requires:
- Running Python code or importing the library
- Direct DynamoDB access credentials
- Understanding the internal API
A webhook interface would enable any system to trigger limit changes via HTTP.
Proposed Solution
Add a webhook endpoint that accepts limit change requests:
POST /webhook/limits
{
"entity_id": "user-123",
"resource": "gpt-4",
"action": "set", // or "scale", "reset", "delete"
"limits": [{"name": "tpm", "capacity": 5000}],
"source": "billing-system",
"idempotency_key": "evt_abc123",
"signature": "..."
}
Potential Backends
| Backend | Pros | Cons |
|---|---|---|
| API Gateway + Lambda | Standard REST, easy to secure | Additional infrastructure |
| EventBridge | AWS-native, rule-based routing | Less portable |
| SNS/SQS | Simple, async | No request/response |
| Function URL | Minimal infra, built into existing Lambda | Less feature-rich than API Gateway |
Success Criteria
- Webhook endpoint accepts limit change requests
- Authentication mechanism (API key, signature, or IAM)
- Idempotent processing of duplicate deliveries
- Audit logs capture webhook source and event details
- CLI can list recent webhook events
- Documentation covers integration patterns for common systems (Stripe, etc.)
Open Questions
- Deployment model - Should the webhook endpoint be part of the CloudFormation stack, or a separate optional component?
- Authentication - API keys? Webhook signatures (like Stripe)? IAM? Multiple options?
- Idempotency - How to handle duplicate webhook deliveries? Store processed
idempotency_keyvalues with TTL? - Backend selection - Should we support multiple backends, or pick one? How do we abstract this?
- Rate limiting the rate limiter - Should the webhook endpoint itself be rate limited?
Related Work
- #222 - Time-based dynamic rate limits
- #223 - Utilization-based adaptive rate limits
- Audit logging captures limit changes (would extend to capture webhook source)
- Part of the Dynamic Rate Limits initiative
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by reviewing the existing Python API, DynamoDB integration, CloudFormation or Lambda deployment, audit logging, and CLI components. Resolve the backend, authentication, idempotency, and deployment questions before defining completion against the listed success criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- api, backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100