The main idea of Rate limiter is to limit expensive resources by some conditions if client has subscription, roles or authenticated.
Rate limiter receives configuration that can be created directly(like in tests) or created by some converters from config file, attributes, etc. Also it receives context that can be created from http context or by other ways.
Assumtions:
no exceptions, only positive cases
all classes are public
no concurrency
What can be improved
policy can have multiple rules or other attributes
converters can be added to provide better and extensible ways of configuration creation
custom middleware can be added with extension
set of rules or conditions can be added
custom scenarios built from multiple rules or conditions can be added
The main idea of Rate limiter is to limit expensive resources by some conditions if client has subscription, roles or authenticated. Rate limiter receives configuration that can be created directly(like in tests) or created by some converters from config file, attributes, etc. Also it receives context that can be created from http context or by other ways.
Assumtions:
What can be improved