Skip to content

Commit 5f15a26

Browse files
committed
Add anonymous throttling rate in test config
Signed-off-by: Tushar Goel <[email protected]>
1 parent c93c5e5 commit 5f15a26

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

vulnerabilities/throttling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def allow_request(self, request, view):
1818
return True
1919

2020
scope = view.throttle_scope
21-
if request.user:
21+
if request.user.is_authenticated:
2222
scope = f"auth_{scope}"
2323
else:
2424
scope = f"anon_{scope}"

vulnerablecode/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
"auth_vulnerable_packages": "1/day",
211211
"auth_bulk_search_packages": "6/day",
212212
"auth_packages": "10/day",
213+
"anon_packages": "10/day",
213214
"auth_vulnerabilities": "8/day",
214215
"auth_aliases": "2/day",
215216
"auth_cpes": "4/day",

0 commit comments

Comments
 (0)