-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
The primary entry point for our rate limiting middleware will be a function that accepts:
- rate limiting method
- GraphQL Schema
- optional
TypeWeightConfigparameters and outputs Express middleware. - redis client
Rate Limiter options should be presented as an enum consisting of Token Bucket, Leaky Bucket, Fixed Window, Sliding Window Log and Sliding Window Counter choices.
During configuration this function should:
- Setup a Redis Client
- Parse the schema using the provided or default
TypeWeightConfigto obtain aTypeWeightObject. - Configure the selected
RateLimiter - Configure complexity analysis algorithm using the
TypeWeightObject - Return express middleware based on the above configuration.
The middleware will need to be able to have access to the GraphQL query , a unique user identifier (such as IP) and request timestamp and will call the next middleware if the request is allowed or reject the request using a 429 status code if the rate limiter denies the request.
Metadata
Metadata
Assignees
Labels
No labels