[proposal] Add support for throttling per route
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
API Gateway has various forms of API throttling. This proposal adds support for throttling at the routing level. This allows you to specify a rate and burst limit per `@app.route`.
Similar to CORS and authorizers, there will be a new param, `throttle`, that takes an instance of `ThrottleConfig`:
```python
@app.route('/', throttle=ThrottleConfig(rate=10, burst=15))
def index(): pass
```
`ThrottleConfig` accepts two arguments, `rate` and `burst`:
```python
class ThrottleConfig(object):
def __init__(self, rate: int, burst: int): pass
```
The `rate` and `burst` params map to the corresponding concepts described in the [API Gateway throttling docs](http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html)
Contributor guide
Research direction
Start at the @app.route implementation and inspect how the existing CORS and authorizer parameters are handled, then review the linked API Gateway throttling documentation. Done means routes can accept a ThrottleConfig with rate and burst values and those limits are mapped to the corresponding API Gateway concepts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100