mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add global admin api key rate limiter (#12527)
This commit is contained in:
@@ -49,12 +49,13 @@ describe 'rate limiter integration' do
|
||||
|
||||
it 'can cleanly limit requests and sets a Retry-After header' do
|
||||
freeze_time
|
||||
#request.set_header("action_dispatch.show_exceptions", true)
|
||||
|
||||
RateLimiter.clear_all!
|
||||
|
||||
admin = Fabricate(:admin)
|
||||
api_key = Fabricate(:api_key, user: admin)
|
||||
|
||||
global_setting :max_admin_api_reqs_per_key_per_minute, 1
|
||||
global_setting :max_admin_api_reqs_per_minute, 1
|
||||
|
||||
get '/admin/api/keys.json', headers: {
|
||||
HTTP_API_KEY: api_key.key,
|
||||
|
||||
Reference in New Issue
Block a user