Merge pull request #209 from abf/rosa-build:192-disable-api-defender-for-our-servers
#192: disable api defender for our servers
This commit is contained in:
commit
d7ddf34c98
|
@ -5,6 +5,8 @@ common: &common
|
|||
preregistration: false
|
||||
file_store_url: 'http://file-store.rosalinux.ru'
|
||||
distr_types: ['mdv', 'rhel', 'nau5']
|
||||
allowed_addresses:
|
||||
- 127.0.0.1
|
||||
abf_worker:
|
||||
publish_workers_count: 2
|
||||
keys:
|
||||
|
|
|
@ -51,7 +51,9 @@ class ApiDefender < Rack::Throttle::Hourly
|
|||
|
||||
# only API calls should be throttled
|
||||
def need_defense?(request)
|
||||
request.env['PATH_INFO'] =~ /^\/api\/v1\// && !system_user?(request)
|
||||
APP_CONFIG['allowed_addresses'].exclude?(request.ip) &&
|
||||
request.env['PATH_INFO'] =~ /^\/api\/v1\// &&
|
||||
!system_user?(request)
|
||||
end
|
||||
|
||||
def authorized?(request)
|
||||
|
|
Loading…
Reference in New Issue