parent
1278d69e87
commit
bc0bbf2524
|
@ -14,6 +14,7 @@ import com.dispose.common.NetflowDirection;
|
||||||
import com.dispose.pojo.entity.ServiceInfo;
|
import com.dispose.pojo.entity.ServiceInfo;
|
||||||
import com.dispose.pojo.po.MulReturnType;
|
import com.dispose.pojo.po.MulReturnType;
|
||||||
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
||||||
|
import com.dispose.security.arithmetic.CryptoHelper;
|
||||||
import com.dptech.dispose.AbnormalFlowCleaningServicePortType;
|
import com.dptech.dispose.AbnormalFlowCleaningServicePortType;
|
||||||
import com.dptech.dispose.ArrayOfProtectionObjectDataForService;
|
import com.dptech.dispose.ArrayOfProtectionObjectDataForService;
|
||||||
import com.dptech.dispose.NtcRequestResultInfo;
|
import com.dptech.dispose.NtcRequestResultInfo;
|
||||||
|
@ -101,7 +102,7 @@ public class DpTechAbilityImpl implements DisposeAbility {
|
||||||
this.cleanTypePort = (AbnormalFlowCleaningServicePortType) jaxWsProxyFactoryBean.create();
|
this.cleanTypePort = (AbnormalFlowCleaningServicePortType) jaxWsProxyFactoryBean.create();
|
||||||
|
|
||||||
Map<String, Object> ctx = ((BindingProvider) this.cleanTypePort).getRequestContext();
|
Map<String, Object> ctx = ((BindingProvider) this.cleanTypePort).getRequestContext();
|
||||||
ctx.put("password", password);
|
ctx.put("password", new String(CryptoHelper.base64Decryption(password)));
|
||||||
ctx.put("username", username);
|
ctx.put("username", username);
|
||||||
|
|
||||||
// 配置连接,访问超时时间
|
// 配置连接,访问超时时间
|
||||||
|
@ -275,7 +276,7 @@ public class DpTechAbilityImpl implements DisposeAbility {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Long toDeviceAttackType(Long ddosAttackTypeMask) {
|
public Long toDeviceAttackType(Long ddosAttackTypeMask) {
|
||||||
return DpTechAttackType.getTypeMaskFromAttackType(new DpTechAttackType[] {DpTechAttackType.UDP_FLOOD});
|
return DpTechAttackType.getTypeMaskFromAttackType(new DpTechAttackType[]{DpTechAttackType.UDP_FLOOD});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.dispose.common.NetflowDirection;
|
||||||
import com.dispose.pojo.entity.ServiceInfo;
|
import com.dispose.pojo.entity.ServiceInfo;
|
||||||
import com.dispose.pojo.po.MulReturnType;
|
import com.dispose.pojo.po.MulReturnType;
|
||||||
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
||||||
|
import com.dispose.security.arithmetic.CryptoHelper;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.huawei.dispose.common.HuaWeiLoginResp;
|
import com.huawei.dispose.common.HuaWeiLoginResp;
|
||||||
import com.huawei.dispose.protocol.HuaWeiInterface;
|
import com.huawei.dispose.protocol.HuaWeiInterface;
|
||||||
|
@ -85,7 +86,7 @@ public class HuaWeiAbilityImpl implements DisposeAbility {
|
||||||
public void initDeviceEnv(String urlPath, String username, String password) {
|
public void initDeviceEnv(String urlPath, String username, String password) {
|
||||||
this.urlRootPath = urlPath;
|
this.urlRootPath = urlPath;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.password = password;
|
this.password = new String(CryptoHelper.base64Decryption(password));
|
||||||
|
|
||||||
upgradeToken();
|
upgradeToken();
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class HuaWeiFireWallAbilityImpl implements DisposeAbility {
|
||||||
public void initDeviceEnv(String urlPath, String username, String password) {
|
public void initDeviceEnv(String urlPath, String username, String password) {
|
||||||
this.urlRootPath = urlPath;
|
this.urlRootPath = urlPath;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.password = password;
|
this.password = new String(CryptoHelper.base64Decryption(password));
|
||||||
|
|
||||||
upgradeToken();
|
upgradeToken();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
|
||||||
import com.dispose.pojo.entity.ServiceInfo;
|
import com.dispose.pojo.entity.ServiceInfo;
|
||||||
import com.dispose.pojo.po.MulReturnType;
|
import com.dispose.pojo.po.MulReturnType;
|
||||||
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
||||||
|
import com.dispose.security.arithmetic.CryptoHelper;
|
||||||
import com.pengxin.dispose.common.PengXinDisposeAbilityRsp;
|
import com.pengxin.dispose.common.PengXinDisposeAbilityRsp;
|
||||||
import com.pengxin.dispose.common.PengXinLoginRsp;
|
import com.pengxin.dispose.common.PengXinLoginRsp;
|
||||||
import com.pengxin.dispose.common.PengXinStartTaskItem;
|
import com.pengxin.dispose.common.PengXinStartTaskItem;
|
||||||
|
@ -127,7 +128,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
public void initDeviceEnv(String urlPath, String username, String password) {
|
public void initDeviceEnv(String urlPath, String username, String password) {
|
||||||
this.urlRootPath = urlPath;
|
this.urlRootPath = urlPath;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.password = password;
|
this.password = new String(CryptoHelper.base64Decryption(password));
|
||||||
restfulInterface.setParams(1, 0);
|
restfulInterface.setParams(1, 0);
|
||||||
|
|
||||||
upgradeToken();
|
upgradeToken();
|
||||||
|
@ -512,7 +513,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
|
|
||||||
if (rspInfo.getCode() == HttpServletResponse.SC_OK &&
|
if (rspInfo.getCode() == HttpServletResponse.SC_OK &&
|
||||||
(status == ErrorCode.ERR_LOGOUT.getCode() || status == ErrorCode.ERR_TOKENTIMEOUT.getCode() ||
|
(status == ErrorCode.ERR_LOGOUT.getCode() || status == ErrorCode.ERR_TOKENTIMEOUT.getCode() ||
|
||||||
status == ErrorCode.ERR_TOKENNOTFOUND.getCode())){
|
status == ErrorCode.ERR_TOKENNOTFOUND.getCode())) {
|
||||||
upgradeToken();
|
upgradeToken();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
|
||||||
import com.dispose.pojo.entity.ServiceInfo;
|
import com.dispose.pojo.entity.ServiceInfo;
|
||||||
import com.dispose.pojo.po.MulReturnType;
|
import com.dispose.pojo.po.MulReturnType;
|
||||||
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
import com.dispose.pojo.vo.DeviceFirewareInfo;
|
||||||
|
import com.dispose.security.arithmetic.CryptoHelper;
|
||||||
import com.pengxin.dispose.common.PengXinStartTaskItem;
|
import com.pengxin.dispose.common.PengXinStartTaskItem;
|
||||||
import com.pengxin.dispose.common.PengXinStartTaskRsp;
|
import com.pengxin.dispose.common.PengXinStartTaskRsp;
|
||||||
import com.pengxin.dispose.common.PengXinStopTaskRsp;
|
import com.pengxin.dispose.common.PengXinStopTaskRsp;
|
||||||
|
@ -102,7 +103,7 @@ public class UpfAbilityImpl extends PengXinAbilityImpl {
|
||||||
public void initDeviceEnv(String urlPath, String username, String password) {
|
public void initDeviceEnv(String urlPath, String username, String password) {
|
||||||
this.urlRootPath = urlPath;
|
this.urlRootPath = urlPath;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.password = password;
|
this.password = new String(CryptoHelper.base64Decryption(password));
|
||||||
restfulInterface.setParams(1, 0);
|
restfulInterface.setParams(1, 0);
|
||||||
//获取token值
|
//获取token值
|
||||||
upgradeToken();
|
upgradeToken();
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.dispose.pojo.entity.DisposeDevice;
|
||||||
import com.dispose.pojo.po.MulReturnType;
|
import com.dispose.pojo.po.MulReturnType;
|
||||||
import com.dispose.security.annotation.Decryption;
|
import com.dispose.security.annotation.Decryption;
|
||||||
import com.dispose.security.annotation.Encryption;
|
import com.dispose.security.annotation.Encryption;
|
||||||
|
import com.dispose.security.arithmetic.CryptoHelper;
|
||||||
import com.dispose.service.DisposeDeviceManagerService;
|
import com.dispose.service.DisposeDeviceManagerService;
|
||||||
import com.dispose.validation.group.ValidGroups;
|
import com.dispose.validation.group.ValidGroups;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
@ -45,6 +46,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -70,7 +72,7 @@ public class DisposeDeviceManagerController {
|
||||||
private DisposeDeviceManagerService disposeDeviceManagerService;
|
private DisposeDeviceManagerService disposeDeviceManagerService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request to device list list.
|
* Request to device list.
|
||||||
*
|
*
|
||||||
* @param req the req
|
* @param req the req
|
||||||
* @return the list
|
* @return the list
|
||||||
|
@ -98,7 +100,7 @@ public class DisposeDeviceManagerController {
|
||||||
.model(v.getModel())
|
.model(v.getModel())
|
||||||
.version(v.getVersion())
|
.version(v.getVersion())
|
||||||
.userName(v.getUserName())
|
.userName(v.getUserName())
|
||||||
.password(v.getPassword())
|
.password(CryptoHelper.base64Encryption(v.getPassword().getBytes(StandardCharsets.UTF_8)))
|
||||||
.urlPath(v.getUrlPath())
|
.urlPath(v.getUrlPath())
|
||||||
.urlType(hType)
|
.urlType(hType)
|
||||||
.readme(v.getReadme())
|
.readme(v.getReadme())
|
||||||
|
|
Loading…
Reference in New Issue