app策略,基础协议,加密隧道行为审核userregion调整
(1)proto_id修改为app_id,配置文件变量名修改为app_id_region (2)提取变量app_cfg_userregion_splitor,值为&到配置文件,app策略,基础协议,加密隧道行为分隔userregion的分隔符
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Map;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
public final class Constants {
|
||||
public static String APP_CFG_USERREGION_SPLITOR=Configurations.getStringProperty("app_cfg_userregion_splitor", "&");
|
||||
/**
|
||||
* MaatConfig 默认值
|
||||
*/
|
||||
@@ -430,7 +431,7 @@ public final class Constants {
|
||||
public static final Integer CLIENT_CONNECT_TIMEOUT = Configurations.getIntProperty("client_connect_timeout",1000);
|
||||
public static final Integer CLIENT_READ_TIMEOUT = Configurations.getIntProperty("client_read_timeout",1000);
|
||||
public static final Integer CLIENT_SOCKET_TIMEOUT = Configurations.getIntProperty("client_socket_timeout",1000);
|
||||
public static final String PROTO_ID_REGION = Configurations.getStringProperty("proto_id_region","PROTO_ID");
|
||||
public static final String APP_ID_REGION = Configurations.getStringProperty("app_id_region","APP_ID");
|
||||
public static final String BEHAV_ID_REGION = Configurations.getStringProperty("behav_id_region","BEHAV_ID");
|
||||
public static final String RATE_LIMIT_REGION = Configurations.getStringProperty("rate_limit_region","RATE_LIMIT");
|
||||
public static final String AREA_REGION = Configurations.getStringProperty("area_region","area_ip");
|
||||
|
||||
@@ -471,25 +471,25 @@ public class AppCfgService extends BaseService {
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equalsIgnoreCase(configType)) {
|
||||
//设置APP自定义域
|
||||
String userRegion = "APP_ID="+entity.getAppCode();
|
||||
String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode();
|
||||
//限速业务需要设置
|
||||
String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit");
|
||||
if(!actionCode.equals("默认")){
|
||||
if(entity.getAction().equals(Integer.parseInt(actionCode))){
|
||||
userRegion += Constants.USER_REGION_SPLIT+Constants.RATE_LIMIT_REGION+"="+entity.getRatelimit();
|
||||
userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.RATE_LIMIT_REGION+"="+entity.getRatelimit();
|
||||
}
|
||||
}
|
||||
if(entity.getBehavCode()!=null) {
|
||||
userRegion += Constants.USER_REGION_SPLIT+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
||||
userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
||||
}
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) {
|
||||
String userRegion = Constants.PROTO_ID_REGION+"="+entity.getAppCode();
|
||||
String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode();
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)) {
|
||||
String userRegion = Constants.PROTO_ID_REGION+"="+entity.getAppCode();
|
||||
String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode();
|
||||
if(entity.getBehavCode()!=null) {
|
||||
userRegion += Constants.USER_REGION_SPLIT+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
||||
userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode();
|
||||
}
|
||||
maatCfg.setUserRegion(userRegion);
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ specific_service_cfg_type_app=social_app
|
||||
specific_service_cfg_type_encrypted_tunnel_behavior=encrypted_tunnel_behavior
|
||||
specific_service_cfg_type_basic_protocol=basic_protocol
|
||||
#基础协议自定义域
|
||||
proto_id_region=PROTO_ID
|
||||
app_id_region=APP_ID
|
||||
#IP默认值
|
||||
ipv4_default_ip_value=\:\:
|
||||
ipv4_default_ip_subnet_value=0.0.0.0/32
|
||||
@@ -446,3 +446,5 @@ maat_cfg_dolog_default=1
|
||||
maat_cfg_dolog_doblacklist_default=1
|
||||
maat_cfg_dolog_configpercent_default=100
|
||||
maat_cfg_dolog_configoption_default=1
|
||||
#app,基础协议,特定服务的userregion分隔符
|
||||
app_cfg_userregion_splitor=&
|
||||
Reference in New Issue
Block a user