carbond.limiter.ReqPropertyLimiterSelector

ReqPropertyLimiterSelector is used to group incoming requests by an arbitrary property on those requests (e.g., req.ip).

Class

class carbond.limiter.LimiterSelector()
propertyPath
String
Required
Description A string representing a property to be resolved as the selector for an incoming request (e.g. “req.user.username”).
transform
Function
Required
Description If this is specified, any property resolved by propertyPath will be passed through transform to generate the appropriate key (useful if the property being resolved is not a String).
hash
String
Description hash evaluates to propertyPath.
key  
Arguments
  • req (request) – the current request
Returns the key used to group the current request or undefined if the key could not be generated
Return type String
Description This resolves the property to be used on req using propertyPath and, if found, passes it through transform if appropriate before returning it.

Example