summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangwei <[email protected]>2019-06-26 15:01:17 +0800
committerwangwei <[email protected]>2019-06-26 15:01:17 +0800
commit714ac134f8efc571d48d8aff311a983adca32b8d (patch)
treed276b080ef5db8cc69e758745909ac77fec5e73e
parenta1f0f432e7fa81ea22c0894d796df6bfbd7d99ea (diff)
添加内置拦截白名单策略
不能修改不能删除不能无效
-rw-r--r--src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml3
-rw-r--r--src/main/resources/sql/20190604/intercept-built-in.sql7
-rw-r--r--src/main/webapp/WEB-INF/tags/sys/delRow.tag11
-rw-r--r--src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp2
4 files changed, 17 insertions, 6 deletions
diff --git a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml
index 505c6b20a..84bd80df6 100644
--- a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml
+++ b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml
@@ -196,8 +196,9 @@
<!-- 判断是否批量操作 -->
<when test="batchValidValue != null and batchValidValue != ''">
AND a.IS_VALID in (${batchValidValue})
- <!-- 批量操作不针对compie_id=0的拦截配置 -->
+ <!-- 批量操作不针对compie_id=0和1的拦截配置 -->
AND a.compile_id != 0
+ AND a.compile_id != 1
</when>
<otherwise>
<if test="isValid != null">
diff --git a/src/main/resources/sql/20190604/intercept-built-in.sql b/src/main/resources/sql/20190604/intercept-built-in.sql
index 5506a7cd6..51eff9d79 100644
--- a/src/main/resources/sql/20190604/intercept-built-in.sql
+++ b/src/main/resources/sql/20190604/intercept-built-in.sql
@@ -4,3 +4,10 @@ VALUES ('default intercept policy', 128, 0, 0, 6, now(), NULL, NULL, NULL, NULL,
INSERT INTO `http_url_cfg`
(`cfg_desc`, `cfg_keywords`, `action`, `is_valid`, `is_audit`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `auditor_id`, `audit_time`, `service_id`, `request_id`, `compile_id`, `is_area_effective`, `classify`, `attribute`, `lable`, `expr_type`, `match_method`, `is_hexbin`, `area_effective_ids`, `function_id`, `cfg_region_code`, `cfg_type`, `ratelimit`, `user_region1`, `user_region2`, `user_region3`, `user_region4`, `user_region5`)
VALUES ('default intercept policy', '20190946.com', 128, 0, 0, 6, now(), NULL, NULL, NULL, NULL, 521, 0, 0, 0, '0', '0', '0', 0, 1, 2, '', 200, 2, 'PXY_INTERCEPT_DOMAIN', NULL, NULL, NULL, NULL, NULL, NULL);
+#添加内置拦截白名单策略
+INSERT INTO `cfg_index_info`
+(`cfg_desc`, `action`, `is_valid`, `is_audit`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `auditor_id`, `audit_time`, `service_id`, `request_id`, `compile_id`, `is_area_effective`, `classify`, `attribute`, `lable`, `area_effective_ids`, `function_id`, `dns_strategy_id`, `do_log`, `user_region1`, `user_region2`, `user_region3`, `user_region4`, `user_region5`, `office_id`, `cancel_request_id`, `source_compile_id`, `do_blacklist`, `common_group_ids`)
+VALUES ('built-in fe3.delivery.mp.microsoft.com', 128, 0, 0, 6, now(), NULL, NULL, NULL, NULL, 521, 0, 1, 0, '0', '0', '0', '', 200, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, '');
+INSERT INTO `http_url_cfg`
+(`cfg_desc`, `cfg_keywords`, `action`, `is_valid`, `is_audit`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `auditor_id`, `audit_time`, `service_id`, `request_id`, `compile_id`, `is_area_effective`, `classify`, `attribute`, `lable`, `expr_type`, `match_method`, `is_hexbin`, `area_effective_ids`, `function_id`, `cfg_region_code`, `cfg_type`, `ratelimit`, `user_region1`, `user_region2`, `user_region3`, `user_region4`, `user_region5`)
+VALUES ('built-in fe3.delivery.mp.microsoft.com', 'fe3.delivery.mp.microsoft.com', 128, 0, 0, 6, now(), NULL, NULL, NULL, NULL, 521, 0, 1, 0, '0', '0', '0', 0, 0, 2, '', 200, 2, 'PXY_INTERCEPT_DOMAIN', NULL, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag
index 5967432bd..87ea76f82 100644
--- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag
+++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag
@@ -252,8 +252,10 @@ function update(url){
top.$.jBox.tip("<spring:message code='built_in_tip'/>", "<spring:message code='info'/>");
return;
}
-
-
+ if(cked.attr("compileId")==1 && cked.attr("serviceId")==521){
+ top.$.jBox.tip('<spring:message code="built_in_tip"/>');
+ return;
+ }
doAll(checkboxes,url);
}else{
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
@@ -322,7 +324,7 @@ function noPassOpt(url){
var builtInCompile=false;
$(checkboxes).filter(":checked").each(function(){
var compileId = $(this).attr("compileId");
- if(compileId == 0){
+ if(compileId == 0 || compileId == 1){
builtInCompile=true;
}
});
@@ -400,7 +402,8 @@ function cancelPassOpt(url){
if(typeof serviceId != "undefined" && serviceIdJudge && typeof compileId != "undefined"){
compileIds.push(compileId);
}
- if((compileId == 0) || (compileId==1 && serviceId==250) || (compileId==1 && serviceId==520)){
+ if((compileId == 0) || (compileId==1 && serviceId==250) || (compileId==1 && serviceId==520)
+ || (compileId==1 && serviceId==521)){
builtInCompile=true;
}
});
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp
index 8a73a864f..852fd0cc0 100644
--- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp
+++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp
@@ -511,7 +511,7 @@
<tr>
<td>
<span <c:if test="${indexCfg.compileId == 0}"> class="hidden"</c:if> id="open${status.index}" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
- <input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}" compileId="${indexCfg.compileId}">
+ <input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}" compileId="${indexCfg.compileId}" serviceId="${indexCfg.serviceId}">
</td>
<td>${indexCfg.compileId }</td>
<td>