oslabs-beta / GraphQL-Gate

A GraphQL rate limiting library with query complexity analysisfor Node.js
http://graphqlgate.io
MIT License
57 stars 2 forks source link

spec for sliding window log. closes #67 #82

Closed shalarewicz closed 2 years ago

shalarewicz commented 2 years ago

Summary

Creates a spec for the SlidingWindowLog rate limiting algorithm. The algorithm will work as follows:

  1. The user's request log is obtained from redis.
  2. Any requests that are older than window size are dropped from the log.
  3. The complexity of the current request is added to the complexity of all requests in the log.
  4. If the request exceeds the specified capacity it is dropped.
  5. Otherwise the request is allowed and the current request is added to the log.

Type of Change

Please delete options that are not relevant.

Issues

Evidence