Skip to content

Commit

Permalink
feature: 白名单IP添加时增加对“执行方式”的判断,如仅开文件分发则在脚本执行中不可选中 TencentBlueKing#115
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonwan authored and hLinx committed Sep 16, 2021
1 parent dc89450 commit f2d473b
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ public List<CloudIPDTO> listWhiteIP(Long appId, ActionScopeEnum actionScope) {
);
}

@Override
public Long saveWhiteIP(String username, WhiteIPRecordCreateUpdateReq createUpdateReq) {
LOG.infoWithRequestId("Input(" + username + "," + createUpdateReq.toString() + ")");
//1.参数校验、预处理
private List<String> checkReqAndGetIpList(WhiteIPRecordCreateUpdateReq createUpdateReq) {
String appIdStr = createUpdateReq.getAppIdStr();
if (null == appIdStr || appIdStr.isEmpty()) {
throw new InvalidParamException("appIdStr", "appIdStr cannot be null or empty");
Expand Down Expand Up @@ -235,6 +232,16 @@ public Long saveWhiteIP(String username, WhiteIPRecordCreateUpdateReq createUpda
throw new InvalidParamException("ipStr", "not a valid ip format");
});
}
return ipList;
}

@Override
public Long saveWhiteIP(String username, WhiteIPRecordCreateUpdateReq createUpdateReq) {
LOG.infoWithRequestId("Input(" + username + "," + createUpdateReq.toString() + ")");
//1.参数校验、预处理
List<String> ipList = checkReqAndGetIpList(createUpdateReq);
List<Long> appIdList = Arrays.stream(createUpdateReq.getAppIdStr().split(","))
.map(Long::parseLong).collect(Collectors.toList());
List<Long> actionScopeIdList = createUpdateReq.getActionScopeIdList();
val ipDtoList = ipList.stream().map(ip -> new WhiteIPIPDTO(
null,
Expand Down

0 comments on commit f2d473b

Please sign in to comment.