Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
  • Loading branch information
TG1999 committed Mar 21, 2023
1 parent f0c50b0 commit 8560853
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
14 changes: 7 additions & 7 deletions docs/source/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ The default throttling settings are defined in ``settings.py``.
To override the default settings, add env variables in ``.env`` file
define the settings there. For example::

ALL_VULNERABLE_PACKAGES_THROTTLING_RATE = '1000/hour'
BULK_SEARCH_PACKAGE_THROTTLING_RATE = '10/minute'
PACKAGES_SEARCH_THROTTLING_RATE = '1000/second'
VULNERABILITIES_SEARCH_THROTTLING_RATE = '1000/hour'
ALIASES_SEARCH_THROTTLING_RATE = '1000/hour'
CPE_SEARCH_THROTTLING_RATE = '10/minute'
BULK_SEARCH_CPE_THROTTLING_RATE = '10/minute'
VULNERABLECODE_ALL_VULNERABLE_PACKAGES_THROTTLING_RATE = '1000/hour'
VULNERABLECODE_BULK_SEARCH_PACKAGE_THROTTLING_RATE = '10/minute'
VULNERABLECODE_PACKAGES_SEARCH_THROTTLING_RATE = '1000/second'
VULNERABLECODE_VULNERABILITIES_SEARCH_THROTTLING_RATE = '1000/hour'
VULNERABLECODE_ALIASES_SEARCH_THROTTLING_RATE = '1000/hour'
VULNERABLECODE_CPE_SEARCH_THROTTLING_RATE = '10/minute'
VULNERABLECODE_BULK_SEARCH_CPE_THROTTLING_RATE = '10/minute'
22 changes: 15 additions & 7 deletions vulnerablecode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,21 @@
LOGOUT_REDIRECT_URL = "/"

REST_FRAMEWORK_DEFAULT_THROTTLE_RATES = {
"vulnerable_packages": env.str("ALL_VULNERABLE_PACKAGES_THROTTLING_RATE", default="1/hour"),
"bulk_search_packages": env.str("BULK_SEARCH_PACKAGE_THROTTLING_RATE", default="5/hour"),
"packages": env.str("PACKAGES_SEARCH_THROTTLING_RATE", default="10/minute"),
"vulnerabilities": env.str("VULNERABILITIES_SEARCH_THROTTLING_RATE", default="10/minute"),
"aliases": env.str("ALIASES_SEARCH_THROTTLING_RATE", default="5/minute"),
"cpes": env.str("CPE_SEARCH_THROTTLING_RATE", default="5/minute"),
"bulk_search_cpes": env.str("BULK_SEARCH_CPE_THROTTLING_RATE", default="5/minute"),
"vulnerable_packages": env.str(
"VULNERABLECODE_ALL_VULNERABLE_PACKAGES_THROTTLING_RATE", default="1/hour"
),
"bulk_search_packages": env.str(
"VULNERABLECODE_BULK_SEARCH_PACKAGE_THROTTLING_RATE", default="5/hour"
),
"packages": env.str("VULNERABLECODE_PACKAGES_SEARCH_THROTTLING_RATE", default="10/minute"),
"vulnerabilities": env.str(
"VULNERABLECODE_VULNERABILITIES_SEARCH_THROTTLING_RATE", default="10/minute"
),
"aliases": env.str("VULNERABLECODE_ALIASES_SEARCH_THROTTLING_RATE", default="5/minute"),
"cpes": env.str("VULNERABLECODE_CPE_SEARCH_THROTTLING_RATE", default="5/minute"),
"bulk_search_cpes": env.str(
"VULNERABLECODE_BULK_SEARCH_CPE_THROTTLING_RATE", default="5/minute"
),
}

if IS_TESTS:
Expand Down

0 comments on commit 8560853

Please sign in to comment.