251117_02_ENH : Security, Swagger, MVC 기본 설정 추가

This commit is contained in:
2025-11-17 15:33:48 +09:00
parent 9f87ce586b
commit e5501e1542
14 changed files with 995 additions and 380 deletions

View File

@@ -0,0 +1,20 @@
package com.kri.common.webmvc;
import lombok.RequiredArgsConstructor;
import org.springframework.security.web.util.matcher.IpAddressMatcher;
import java.util.List;
@RequiredArgsConstructor
public class IpAccessControlService {
private final KriIpAccessProperties properties;
public boolean isAccessible(String ipAddress) {
List<String> cidrs = properties.getEffectiveCidrs();
return cidrs.stream()
.map(IpAddressMatcher::new)
.anyMatch(matcher -> matcher.matches(ipAddress));
}
}