mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Merge pull request #1748 from internetee/983-enable-subnets-in-whitelisting
Enable WhiteIp for checking against subnets
This commit is contained in:
commit
60ad79178e
3 changed files with 60 additions and 4 deletions
|
@ -29,6 +29,16 @@ class RegistrarAreaBaseTestTest < ApplicationSystemTestCase
|
|||
assert_button 'Login'
|
||||
end
|
||||
|
||||
def test_user_can_access_when_ip_is_whitelisted_with_subnet
|
||||
white_ips(:one).update!(ipv4: '127.0.0.1/32', interfaces: [WhiteIp::REGISTRAR])
|
||||
Setting.registrar_ip_whitelist_enabled = true
|
||||
|
||||
visit new_registrar_user_session_url
|
||||
|
||||
assert_no_text 'Access denied from IP 127.0.0.1'
|
||||
assert_button 'Login'
|
||||
end
|
||||
|
||||
def test_user_can_access_when_ip_is_not_whitelisted_and_whitelist_is_disabled
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
WhiteIp.delete_all
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue