验证代理对象的证书是否被拦截策略引用,如被引用,则证书配置不能取消。
This commit is contained in:
@@ -41,6 +41,7 @@ import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.PxyObjKeyring;
|
||||
@@ -911,4 +912,31 @@ public class PxyObjKeyringController extends BaseController {
|
||||
}
|
||||
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证Keyring是否有被使用
|
||||
*
|
||||
* @param entity
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = { "/ajaxKeyinfIsUsed" })
|
||||
public boolean ajaxKeyinfIsUsed(String[] compileIds, HttpServletRequest request, HttpServletResponse response) {
|
||||
for(String compileId:compileIds){
|
||||
CfgIndexInfo cfg = new CfgIndexInfo();
|
||||
cfg.setIsAudit(1);
|
||||
cfg.setIsValid(1);
|
||||
cfg.setFunctionId(200);//代理拦截策略
|
||||
cfg.setServiceId(512);
|
||||
cfg.setUserRegion1(compileId);
|
||||
List<CfgIndexInfo> list = httpRedirectCfgService.getCfgIndexInfos(cfg);
|
||||
if (list.size() > 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,6 +371,17 @@
|
||||
<if test="sourceCompileId != null">
|
||||
and source_compile_id=#{sourceCompileId}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
and is_valid=#{isValid}
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
and is_audit=#{isAudit}
|
||||
</if>
|
||||
<!-- 代理拦截策略 -->
|
||||
<if test="functionId != null and functionId=200">
|
||||
and a.user_region1=#{userRegion1}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
<select id="getIpPortList" resultMap="ipPortMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
|
||||
@@ -54,6 +54,10 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
|
||||
public List<CfgIndexInfo> getCfgIndexInfos(CfgIndexInfo entity){
|
||||
return websiteCfgDao.getCfgIndexInfos(entity);
|
||||
}
|
||||
|
||||
public CfgIndexInfo getHttpCfg(Long cfgId,Integer compileId){
|
||||
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId,compileId);
|
||||
List<HttpUrlCfg> httpUrlList = websiteCfgDao.getHttpUrlList(entity);
|
||||
|
||||
Reference in New Issue
Block a user