(1)调整拦截action 为2
(2)修复导出bug
This commit is contained in:
@@ -8,41 +8,41 @@ public class PxyInterceptCfg extends CfgIndexInfo {
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 994229066993318362L;
|
||||
@ExcelField(title="pxy_intercept_monit_keyring",sort=7)
|
||||
@ExcelField(title="pxy_intercept_monit_keyring",sort=8)
|
||||
private String keyring;
|
||||
@ExcelField(title="exclusions_ev_cert",dictType="SYS_YES_NO",sort=8)
|
||||
@ExcelField(title="exclusions_ev_cert",dictType="SYS_YES_NO",sort=9)
|
||||
private String evCert;
|
||||
@ExcelField(title="exclusions_cert_transparency",dictType="SYS_YES_NO",sort=9)
|
||||
@ExcelField(title="exclusions_cert_transparency",dictType="SYS_YES_NO",sort=10)
|
||||
private String certTransparency;
|
||||
@ExcelField(title="exclusions_client_cert_req",dictType="SYS_YES_NO",sort=10)
|
||||
@ExcelField(title="exclusions_client_cert_req",dictType="SYS_YES_NO",sort=11)
|
||||
private String clientCertReq;
|
||||
@ExcelField(title="exclusions_pinning",dictType="SYS_YES_NO",sort=11)
|
||||
@ExcelField(title="exclusions_pinning",dictType="SYS_YES_NO",sort=12)
|
||||
private String pinning;
|
||||
@ExcelField(title="cert_verify_approach_cn",dictType="SYS_YES_NO",sort=12)
|
||||
@ExcelField(title="cert_verify_approach_cn",dictType="SYS_YES_NO",sort=13)
|
||||
private String cn;
|
||||
@ExcelField(title="cert_verify_approach_issuer",dictType="SYS_YES_NO",sort=13)
|
||||
@ExcelField(title="cert_verify_approach_issuer",dictType="SYS_YES_NO",sort=14)
|
||||
private String issuer;
|
||||
@ExcelField(title="cert_verify_approach_self_signed",dictType="SYS_YES_NO",sort=14)
|
||||
@ExcelField(title="cert_verify_approach_self_signed",dictType="SYS_YES_NO",sort=15)
|
||||
private String selfSigned;
|
||||
@ExcelField(title="cert_verify_approach_expiration",dictType="SYS_YES_NO",sort=15)
|
||||
@ExcelField(title="cert_verify_approach_expiration",dictType="SYS_YES_NO",sort=16)
|
||||
private String expiration;
|
||||
@ExcelField(title="cert_verify_fail_method",dictType="FAIL_METHOD",sort=16)
|
||||
@ExcelField(title="cert_verify_fail_method",dictType="FAIL_METHOD",sort=17)
|
||||
private String failMethod;
|
||||
@ExcelField(title="ssl_ver_min",dictType="SSL_VERSION",sort=17)
|
||||
@ExcelField(title="ssl_ver_min",dictType="SSL_VERSION",sort=18)
|
||||
private String min;
|
||||
@ExcelField(title="ssl_ver_max",dictType="SSL_VERSION",sort=18)
|
||||
@ExcelField(title="ssl_ver_max",dictType="SSL_VERSION",sort=19)
|
||||
private String max;
|
||||
@ExcelField(title="ssl_ver_mirror_client",dictType="SYS_YES_NO",sort=19)
|
||||
@ExcelField(title="ssl_ver_mirror_client",dictType="SYS_YES_NO",sort=20)
|
||||
private String mirrorClient;
|
||||
@ExcelField(title="decrypt_mirror_enable",dictType="SYS_YES_NO",sort=20)
|
||||
@ExcelField(title="decrypt_mirror_enable",dictType="SYS_YES_NO",sort=21)
|
||||
private String enable;
|
||||
@ExcelField(title="decrypt_mirror_mirror_profile",sort=21)
|
||||
@ExcelField(title="decrypt_mirror_mirror_profile",sort=22)
|
||||
private String mirrorProfile;
|
||||
private String userRegion1;
|
||||
private String userRegion2;
|
||||
private String userRegion3;
|
||||
private String userRegion4;
|
||||
private String userRegion5;
|
||||
// private String userRegion5;
|
||||
public String getKeyring() {
|
||||
return keyring;
|
||||
}
|
||||
|
||||
@@ -2861,8 +2861,8 @@ public class ExportExcel {
|
||||
/**
|
||||
* 构造函数
|
||||
* @param msgProp 国际化配置
|
||||
* @param title sheet名称
|
||||
* @param cls 实体对象,通过annotation.ExportField获取标题
|
||||
* @param titleList sheet名称
|
||||
* @param clsMap 实体对象,通过annotation.ExportField获取标题
|
||||
* @param type 导出类型(1:导出数据;2:导出模板)
|
||||
* @param groups 导入分组
|
||||
* @return
|
||||
|
||||
@@ -121,7 +121,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
String direction = regionDict.getConfigDirection();
|
||||
StringBuffer errTip = new StringBuffer();
|
||||
// 因IP拦截 监测
|
||||
if(regionDict.getFunctionId().equals(200) && serviceDict.getAction().equals(1)){
|
||||
if(regionDict.getFunctionId().equals(200) && serviceDict.getAction().equals(2)){
|
||||
protocol="6";
|
||||
}
|
||||
List<SysDataDictionaryItem> sslversions = new ArrayList<>();
|
||||
@@ -150,7 +150,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
|
||||
if(regionDict.getFunctionId().equals(200)) {
|
||||
if(!serviceDict.getAction().equals(1)) {
|
||||
if(!serviceDict.getAction().equals(2)) {
|
||||
baseIpCfg.setDoLog(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
|
||||
if(regionDict.getFunctionId().equals(200)) {
|
||||
if(!serviceDict.getAction().equals(1)) {
|
||||
if(!serviceDict.getAction().equals(2)) {
|
||||
baseStringCfg.setDoLog(0);
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
// 代理-域名拦截
|
||||
if (regionDict.getFunctionId().equals(200) && "intercept_domain".equals(regionDict.getConfigServiceType())) {
|
||||
if(serviceDict.getAction().equals(1)) {
|
||||
/*if(serviceDict.getAction().equals(1)) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion5())) {
|
||||
baseStringCfg.setUserRegion5("1");
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
|
||||
}else if(serviceDict.getAction().equals(64)) {
|
||||
}else*/ if(serviceDict.getAction().equals(64)) {
|
||||
baseStringCfg.setUserRegion1("0");// limit_rate_type(限速方式默认值)
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion2())) {
|
||||
baseStringCfg.setUserRegion2("0.1");
|
||||
|
||||
@@ -198,8 +198,7 @@ public class IpController extends BaseController{
|
||||
*
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param auditType 审核类型 :批量审核时使用,1批量生效,0批量失效
|
||||
* @param isAudit
|
||||
* @param isAudit 审核类型 :批量审核时使用,1批量生效,0批量失效
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
@@ -481,7 +480,7 @@ public class IpController extends BaseController{
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpRateLimitTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if(serviceDict.getServiceId().equals(512)){
|
||||
}else if(serviceDict.getAction().equals(2)){//forward
|
||||
List<InterceptIpTemplate> classList=new ArrayList<InterceptIpTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, InterceptIpTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
@@ -528,7 +527,7 @@ public class IpController extends BaseController{
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if(regionDict.getFunctionId().equals(200)){// 拦截策略(域名)
|
||||
if(serviceDict.getAction().equals(1)){// 监测
|
||||
if(serviceDict.getAction().equals(2)){// forward
|
||||
List<InterceptDomainTemplate> classList=new ArrayList<InterceptDomainTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, InterceptDomainTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
|
||||
@@ -122,7 +122,7 @@ public class InterceptController extends CommonController {
|
||||
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request,
|
||||
HttpServletResponse response, String ids, CfgIndexInfo entity) {
|
||||
try {
|
||||
if(!entity.getAction().equals(1)||!entity.getServiceId().equals(512)) {
|
||||
if(!entity.getAction().equals(2)||!entity.getServiceId().equals(512)) {
|
||||
entity.setUserRegion(null);
|
||||
}else {
|
||||
if(entity.getUserRegion()==null) {
|
||||
@@ -476,6 +476,7 @@ public class InterceptController extends CommonController {
|
||||
}
|
||||
// 获取证书信息
|
||||
List<PxyObjKeyring> certificateList = new ArrayList<PxyObjKeyring>();
|
||||
//获取镜像相关信息
|
||||
List<ProxyFileTrafficMirrorCfg> mirrorProfileList=new ArrayList<>();
|
||||
if (entity.getFunctionId().equals(200)) {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
@@ -494,7 +495,7 @@ public class InterceptController extends CommonController {
|
||||
}
|
||||
str.setUserRegion(new HashMap<String,Object>());
|
||||
if (certificateList != null) {
|
||||
if (entity.getFunctionId() == 200 ) {
|
||||
if (entity.getFunctionId().equals(200) ) {
|
||||
if (!StringUtil.isEmpty(str.getUserRegion1())&&str.getUserRegion1().startsWith("{")) {
|
||||
|
||||
Map<String,Object> userregion=BaseService.gsonFromJson(str.getUserRegion1(), Map.class);
|
||||
@@ -576,16 +577,16 @@ public class InterceptController extends CommonController {
|
||||
String cfgIndexInfoNoExport = "";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",letter,whether_area_block,classification,attribute,label,block_type,"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String interceptNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",letter,whether_area_block,classification,attribute,label,block_type,"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String httpUrlCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,block_type,";
|
||||
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> httpUrlList = new ArrayList<BaseStringCfg>();
|
||||
@@ -607,26 +608,31 @@ public class InterceptController extends CommonController {
|
||||
pktBinList.addAll(maps.get("PXY_INTERCEPT_PKT_BIN"));
|
||||
if (entity.getFunctionId() == 200){
|
||||
Properties msgProp = getMsgProp();
|
||||
if(cfg.getAction().equals(1)) {
|
||||
cfg.setUserRegion5(msgProp.getProperty("intercept"));
|
||||
if(cfg.getAction().equals(2)) {
|
||||
pxyInterceptCfgs.get(index).setUserRegion5(msgProp.getProperty("intercept"));
|
||||
}else if(cfg.getAction().equals(48)) {
|
||||
cfg.setUserRegion5(msgProp.getProperty("action_spoofing"));
|
||||
pxyInterceptCfgs.get(index).setUserRegion5(msgProp.getProperty("action_spoofing"));
|
||||
}else if(cfg.getAction().equals(128)) {
|
||||
cfg.setUserRegion5(msgProp.getProperty("bypass"));
|
||||
pxyInterceptCfgs.get(index).setUserRegion5(msgProp.getProperty("bypass"));
|
||||
}else {
|
||||
cfg.setUserRegion5(msgProp.getProperty(DictUtils.getDictLabels("SERVICE_ACTION", cfg.getAction().toString(), cfg.getAction().toString())));
|
||||
pxyInterceptCfgs.get(index).setUserRegion5(msgProp.getProperty(DictUtils.getDictLabels("SERVICE_ACTION", cfg.getAction().toString(), cfg.getAction().toString())));
|
||||
}
|
||||
}
|
||||
if (214==entity.getFunctionId()) {
|
||||
if (!StringUtil.isBlank(cfg.getUserRegion1())) {
|
||||
cfg.setUserRegion1(DictUtils.getDictLabels("SPOOFING_IP_TYPE", cfg.getUserRegion1(),cfg.getUserRegion1()));
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
if (214==entity.getFunctionId()) {
|
||||
//为何多循环一次???
|
||||
/*if (214==entity.getFunctionId()) {
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if (!StringUtil.isBlank(cfg.getUserRegion1())) {
|
||||
cfg.setUserRegion1(DictUtils.getDictLabels("SPOOFING_IP_TYPE", cfg.getUserRegion1(),cfg.getUserRegion1()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
pktBinList = BaseStringCfg.replaceBaseKeyList(pktBinList);
|
||||
httpUrlList = BaseStringCfg.baseHexList(httpUrlList);
|
||||
@@ -647,11 +653,15 @@ public class InterceptController extends CommonController {
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList);
|
||||
} else if (entity.getFunctionId() == 200) {// IP拦截
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,block_type,&userregion1:intercept_file_strategy-userregion2:ratelimit-userregion5:block_type";
|
||||
cfgIndexInfoNoExport = ",userRegion1,userRegion5,do_log,policy_name,group_name,userregion3,userregion4,block_type,&userregion2:ratelimit-userregion5:block_type";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
titleList.add("PXY_INTERCEPT_DOMAIN");
|
||||
classMap.put("PXY_INTERCEPT_DOMAIN", HttpUrlCfg.class);
|
||||
noExportMap.put("PXY_INTERCEPT_DOMAIN", httpUrlCfgNoExport);
|
||||
dataMap.put("PXY_INTERCEPT_DOMAIN", httpUrlList);
|
||||
} else if (entity.getFunctionId() == 201) {// 域名拦截
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:intercept_file_strategy-userregion5:intercept_intensity-";
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
|
||||
Reference in New Issue
Block a user