This is a set of command line scripts that can be used to interact with some of the rate limit safe-list files.
- AddToRateLimit.js: Add a new key to a specific rate limit file. Will not overwrite if existing
- CheckForKey.js: Search two of the main rate files for a specific key and return the values used
- RemoveRateLimit.js: Remove an existing key from a specific rate limit file
- RateLimitFileFactory.js: Used to create a new rate limit file based on file type
- Config.json: template config file. Make a copy as "Config.dev.json" to use locally
- Models/RateLimitFile.js: Base class for rate limit file
- Models/InstanceRateFile.js: Class defining rate file for instance IDs
- Models/ApplicationRateLimitFile.js: Class defining rate file for App IDs
Note
Assumed that NodeJS is installed and available on the command line
- Checkout this repo into any directory.
- Make a copy of "Config.json" as "Config.dev.json"
- Edit "Config.dev.json" and change the bucketDirectory to point to the bucket folder in the rate limit darkly folder
Example: node .\AddToRateLimit.js appid wacky 300 344
Expected: ListType SourceID RateLimit [LogLimit]
ListType - appid or instanceid
SourceID - appid or instanceid value based on ListType
RateLimit - Integer value; default: 0
LogLimit - Integer value; default: 30000; Only for appid
Example: node .\CheckForKey.js wacky
Expected: [KeyID]
KeyID - AppID or InstanceID to lookup
Example: node .\AddToRateLimit.js appid wacky 300 344
Expected: ListType SourceID RateLimit
ListType - appid or instanceid
SourceID - appid or instanceid value based on ListType
RateLimit - rate limit to remove instanceID from (Instance ID only)
- Pickup/Review all extra files
- Provide more control over having multiple targets defined when adding instance IDs
- Replace term whitelist with "safelist"