-
Notifications
You must be signed in to change notification settings - Fork 467
feat: Add rate limiting to identity search endpoint #6438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
eb6c827
db1cc77
14dc93f
aa244d5
a11a21e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -305,6 +305,28 @@ def test_search_identities_still_allows_paging( | |||||||
| assert response2.data["results"] | ||||||||
|
|
||||||||
|
|
||||||||
| def test_identity_search_is_throttled( | ||||||||
| admin_client: APIClient, | ||||||||
| environment: Environment, | ||||||||
| settings, | ||||||||
|
||||||||
| settings, | |
| settings, | |
| reset_cache, |
cursor[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,10 +4,10 @@ import useDebounce from './useDebounce' | |
| export default function useDebouncedSearch(initialValue = '') { | ||
| const [searchInput, setSearchInput] = useState(initialValue) | ||
| const [search, setSearch] = useState(initialValue) | ||
| const [debounceTime, setDebounceTime] = useState(500) | ||
| const [debounceTime, setDebounceTime] = useState(750) | ||
|
|
||
| useEffect(() => { | ||
| setDebounceTime(searchInput.length < 1 ? 0 : 500) | ||
| setDebounceTime(searchInput.length < 1 ? 0 : 750) | ||
|
Comment on lines
+7
to
+10
|
||
| }, [searchInput]) | ||
|
|
||
| const debouncedSearch = useDebounce((value: string) => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.