Allow Singapore login region
This commit is contained in:
parent
32a1094edc
commit
1e94443ee5
@ -39,10 +39,10 @@ public class LoginAccessValidationService {
|
||||
"香港", "澳门", "澳門", "台湾", "台灣", "Hong Kong", "Macau", "Macao", "Taiwan"
|
||||
);
|
||||
private static final List<String> BLOCKED_COUNTRY_CODES = List.of(
|
||||
"MO", "SG"
|
||||
"MO"
|
||||
);
|
||||
private static final List<String> BLOCKED_COUNTRY_NAMES = List.of(
|
||||
"澳门", "澳門", "Macau", "Macao", "新加坡", "Singapore"
|
||||
"澳门", "澳門", "Macau", "Macao"
|
||||
);
|
||||
private static final List<IpGeoProvider> IP_GEO_PROVIDERS = List.of(
|
||||
new IpGeoProvider("ip.sb", "https://api.ip.sb/geoip/%s"),
|
||||
|
||||
@ -98,12 +98,12 @@ public class LoginAccessValidationServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void blockSingaporeCountryCode() {
|
||||
public void allowSingaporeCountryCode() {
|
||||
JSONObject data = JSON.parseObject("""
|
||||
{"country_id":"SG","country":"Singapore","region":""}
|
||||
""");
|
||||
|
||||
assertTrue(LoginAccessValidationService.isBlockedIpRegion(data));
|
||||
assertFalse(LoginAccessValidationService.isBlockedIpRegion(data));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@ -32,10 +32,10 @@ public class IpCountryUtils {
|
||||
"香港", "澳门", "澳門", "台湾", "台灣", "Hong Kong", "Macau", "Macao", "Taiwan"
|
||||
);
|
||||
private static final List<String> BLOCKED_COUNTRY_CODES = List.of(
|
||||
"MO", "SG"
|
||||
"MO"
|
||||
);
|
||||
private static final List<String> BLOCKED_COUNTRY_NAMES = List.of(
|
||||
"澳门", "澳門", "Macau", "Macao", "新加坡", "Singapore"
|
||||
"澳门", "澳門", "Macau", "Macao"
|
||||
);
|
||||
private static final List<IpGeoProvider> IP_GEO_PROVIDERS = List.of(
|
||||
new IpGeoProvider("ip.sb", "https://api.ip.sb/geoip/%s"),
|
||||
|
||||
@ -92,10 +92,10 @@ public class IpCountryUtilsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void blockSingaporeCountryCode() {
|
||||
public void allowSingaporeCountryCode() {
|
||||
IpCountryUtils.IpGeoData data = new IpCountryUtils.IpGeoData("SG", "Singapore", "", "test");
|
||||
|
||||
assertTrue(IpCountryUtils.isBlockedIpRegion(data));
|
||||
assertFalse(IpCountryUtils.isBlockedIpRegion(data));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user