Commit b7dba7b5 authored by pobu168's avatar pobu168
Browse files

Merge branch '2289_workflow_interf_enhance' of...

Merge branch '2289_workflow_interf_enhance' of github.com:WeBankPartners/wecube-platform into 2289_workflow_interf_enhance
parents dbf5699e bc354c97
Showing with 626 additions and 167 deletions
+626 -167
......@@ -115,6 +115,8 @@ public class ApplicationProperties {
private Integer staticResourceServerPort;
private String staticResourceServerPath;
private String baseMountPath;
private String staticResourceServerAuthMode;
private String staticResourceServerKeyPath;
public String getPluginDeployPath() {
return pluginDeployPath;
......@@ -228,6 +230,22 @@ public class ApplicationProperties {
this.baseMountPath = baseMountPath;
}
public String getStaticResourceServerAuthMode() {
return staticResourceServerAuthMode;
}
public void setStaticResourceServerAuthMode(String staticResourceServerAuthMode) {
this.staticResourceServerAuthMode = staticResourceServerAuthMode;
}
public String getStaticResourceServerKeyPath() {
return staticResourceServerKeyPath;
}
public void setStaticResourceServerKeyPath(String staticResourceServerKeyPath) {
this.staticResourceServerKeyPath = staticResourceServerKeyPath;
}
}
@ConfigurationProperties(prefix = "wecube.core.s3")
......
......@@ -30,6 +30,8 @@ public class ResourceServerDto {
private long createdDate;
private String updatedBy;
private long updatedDate;
private String loginMode;
@JsonIgnore
private List<ResourceItemDto> resourceItemDtos;
......@@ -37,27 +39,6 @@ public class ResourceServerDto {
super();
}
public ResourceServerDto(String id, String name, String host, String port, String loginUsername,
String loginPassword, String type, Boolean isAllocated, String purpose, String status, String createdBy,
long createdDate, String updatedBy, long updatedDate, List<ResourceItemDto> resourceItemDtos) {
super();
this.id = id;
this.name = name;
this.host = host;
this.port = port;
this.loginUsername = loginUsername;
this.loginPassword = loginPassword;
this.type = type;
this.isAllocated = isAllocated;
this.purpose = purpose;
this.status = status;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.updatedBy = updatedBy;
this.updatedDate = updatedDate;
this.resourceItemDtos = resourceItemDtos;
}
public static ResourceServerDto fromDomain(ResourceServer resourceServer) {
ResourceServerDto resourceServerDto = new ResourceServerDto();
resourceServerDto.setId(resourceServer.getId());
......@@ -75,6 +56,8 @@ public class ResourceServerDto {
resourceServerDto.setCreatedDate(resourceServer.getCreatedDate().getTime());
resourceServerDto.setUpdatedBy(resourceServer.getUpdatedBy());
resourceServerDto.setUpdatedDate(resourceServer.getUpdatedDate().getTime());
resourceServerDto.setLoginMode(resourceServer.getLoginMode());
// resourceServerDto.setSshKey(resourceServer.getSshKey());
if (resourceServer.getResourceItems() != null) {
resourceServerDto.setResourceItemDtos(
Lists.transform(resourceServer.getResourceItems(), x -> ResourceItemDto.fromDomain(x)));
......@@ -129,6 +112,14 @@ public class ResourceServerDto {
validateItemStatus(resourceServerDto.getStatus());
resourceServer.setStatus(resourceServerDto.getStatus());
}
if(resourceServerDto.getLoginMode() != null) {
resourceServer.setLoginMode(resourceServerDto.getLoginMode());
}
// if(resourceServerDto.getSshKey() != null) {
// resourceServer.setSshKey(resourceServerDto.getSshKey());
// }
updateSystemFieldsWithDefaultValues(resourceServer);
......@@ -285,4 +276,13 @@ public class ResourceServerDto {
public void setResourceItemDtos(List<ResourceItemDto> resourceItemDtos) {
this.resourceItemDtos = resourceItemDtos;
}
public String getLoginMode() {
return loginMode;
}
public void setLoginMode(String loginMode) {
this.loginMode = loginMode;
}
}
......@@ -6,6 +6,8 @@ public class PluginPackageRuntimeResourcesS3 {
private String pluginPackageId;
private String bucketName;
private String additionalProperties;
public String getId() {
return id;
......@@ -30,4 +32,14 @@ public class PluginPackageRuntimeResourcesS3 {
public void setBucketName(String bucketName) {
this.bucketName = bucketName == null ? null : bucketName.trim();
}
public String getAdditionalProperties() {
return additionalProperties;
}
public void setAdditionalProperties(String additionalProperties) {
this.additionalProperties = additionalProperties;
}
}
\ No newline at end of file
package com.webank.wecube.platform.core.entity.plugin;
public class ResourceS3AdditionalProperties {
private ResourceS3FileSetInfo fileSet;
public ResourceS3FileSetInfo getFileSet() {
return fileSet;
}
public void setFileSet(ResourceS3FileSetInfo fileSet) {
this.fileSet = fileSet;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ResourceS3AdditionalProperties [fileSet=");
builder.append(fileSet);
builder.append("]");
return builder.toString();
}
}
package com.webank.wecube.platform.core.entity.plugin;
public class ResourceS3FileInfo {
private String source;
private String toFile;
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getToFile() {
return toFile;
}
public void setToFile(String toFile) {
this.toFile = toFile;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ResourceS3FileInfo [source=");
builder.append(source);
builder.append(", toFile=");
builder.append(toFile);
builder.append("]");
return builder.toString();
}
}
package com.webank.wecube.platform.core.entity.plugin;
import java.util.ArrayList;
import java.util.List;
public class ResourceS3FileSetInfo {
private List<ResourceS3FileInfo> files = new ArrayList<>();
public List<ResourceS3FileInfo> getFiles() {
return files;
}
public void setFiles(List<ResourceS3FileInfo> files) {
this.files = files;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ResourceS3FileSetInfo [files=");
builder.append(files);
builder.append("]");
return builder.toString();
}
}
......@@ -35,7 +35,6 @@ public class ResourceServer {
//
private String loginMode;// PASSWD,KEY,PUBKEY
private String sshKey;
private transient List<ResourceItem> resourceItems = new ArrayList<>();
......@@ -167,12 +166,4 @@ public class ResourceServer {
this.loginMode = loginMode;
}
public String getSshKey() {
return sshKey;
}
public void setSshKey(String sshKey) {
this.sshKey = sshKey;
}
}
\ No newline at end of file
......@@ -51,13 +51,13 @@ public class CommandService {
log.info("Execute '{}' command successful", command);
}
public String runAtRemote(String host, String user, String password, Integer port, String command)
public String runAtRemote(RemoteCommandExecutorConfig config, String command)
throws Exception {
RemoteCommandExecutorConfig config = new RemoteCommandExecutorConfig();
config.setRemoteHost(host);
config.setUser(user);
config.setPsword(password);
config.setPort(port);
// RemoteCommandExecutorConfig config = new RemoteCommandExecutorConfig();
// config.setRemoteHost(host);
// config.setUser(user);
// config.setPsword(password);
// config.setPort(port);
RemoteCommand cmd = new SimpleRemoteCommand(command);
PooledRemoteCommandExecutor executor = new PooledRemoteCommandExecutor();
......@@ -76,27 +76,27 @@ public class CommandService {
}
}
public String runAtRemoteHasReturn(String host, String user, String password, Integer port, String command)
throws Exception {
RemoteCommandExecutorConfig config = new RemoteCommandExecutorConfig();
config.setRemoteHost(host);
config.setUser(user);
config.setPsword(password);
config.setPort(port);
RemoteCommand cmd = new SimpleRemoteCommand(command);
PooledRemoteCommandExecutor executor = new PooledRemoteCommandExecutor();
executor.init(config);
String result = executor.execute(cmd);
executor.destroy();
log.info("result is: " + result);
if (result == "" || result.isEmpty()) {
throw new WecubeCoreException("3221", "return is empty, please check !");
} else {
return result;
}
}
// public String runAtRemoteHasReturn(RemoteCommandExecutorConfig config, String command)
// throws Exception {
//// RemoteCommandExecutorConfig config = new RemoteCommandExecutorConfig();
//// config.setRemoteHost(host);
//// config.setUser(user);
//// config.setPsword(password);
//// config.setPort(port);
//
// RemoteCommand cmd = new SimpleRemoteCommand(command);
// PooledRemoteCommandExecutor executor = new PooledRemoteCommandExecutor();
// executor.init(config);
//
// String result = executor.execute(cmd);
//
// executor.destroy();
//
// log.info("result is: " + result);
// if (result == "" || result.isEmpty()) {
// throw new WecubeCoreException("3221", "return is empty, please check !");
// } else {
// return result;
// }
// }
}
......@@ -5,6 +5,8 @@ public class RemoteCommandExecutorConfig {
private int port;
private String user;
private String psword;
private String authMode;//PASSWD,KEY
public String getRemoteHost() {
return remoteHost;
......@@ -38,4 +40,11 @@ public class RemoteCommandExecutorConfig {
this.port = port;
}
public String getAuthMode() {
return authMode;
}
public void setAuthMode(String authMode) {
this.authMode = authMode;
}
}
......@@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import com.webank.wecube.platform.core.commons.WecubeCoreException;
import com.webank.wecube.platform.core.utils.Constants;
import ch.ethz.ssh2.Connection;
import ch.ethz.ssh2.SCPClient;
......@@ -84,8 +85,44 @@ public class ScpService {
connection.close();
}
}
public void put(RemoteCommandExecutorConfig config,String localFile,
String remoteTargetDirectory) {
if(Constants.SSH_AUTH_MODE_KEY.equalsIgnoreCase(config.getAuthMode())) {
putWithPrivateKey(config.getRemoteHost(), config.getPort(), config.getUser(), config.getPsword(), localFile,
remoteTargetDirectory);
}else {
put(config.getRemoteHost(), config.getPort(), config.getUser(), config.getPsword(), localFile,
remoteTargetDirectory);
}
}
private void putWithPrivateKey(String ip, Integer port, String user, String privateKey, String localFile,
String remoteTargetDirectory) {
Connection conn = new Connection(ip, port);
try {
conn.connect();
boolean isconn = conn.authenticateWithPublicKey(user, privateKey.toCharArray(), null);
if (isconn) {
log.info("Connection is OK");
SCPClient scpClient = conn.createSCPClient();
log.info("scp local file [{}] to remote target directory [{}]", localFile, remoteTargetDirectory);
scpClient.put(localFile, remoteTargetDirectory, "7777");
} else {
log.info("User or password incorrect");
throw new WecubeCoreException("3222", "User or password incorrect");
}
} catch (Exception e) {
log.error("errors while putting file.", e);
throw new WecubeCoreException("3223", String.format("Run 'scp' command meet error: %s", e.getMessage()));
} finally {
conn.close();
}
}
public void put(String ip, Integer port, String user, String password, String localFile,
private void put(String ip, Integer port, String user, String password, String localFile,
String remoteTargetDirectory) {
Connection conn = new Connection(ip, port);
try {
......
......@@ -16,6 +16,7 @@ import org.slf4j.LoggerFactory;
import com.webank.wecube.platform.core.service.cmder.ssh2.PoolableRemoteCommandExecutor;
import com.webank.wecube.platform.core.service.cmder.ssh2.RemoteCommand;
import com.webank.wecube.platform.core.service.cmder.ssh2.RemoteCommandExecutorConfig;
import com.webank.wecube.platform.core.utils.Constants;
import ch.ethz.ssh2.ChannelCondition;
import ch.ethz.ssh2.Connection;
......@@ -57,7 +58,7 @@ public class PooledRemoteCommandExecutor implements PoolableRemoteCommandExecuto
} catch (IOException e) {
LOGGER.error("failed to init executor", e);
this.destroy();
throw new Exception("failed to init executor:"+e.getMessage());
throw new Exception("failed to init executor:" + e.getMessage());
}
}
......@@ -79,7 +80,18 @@ public class PooledRemoteCommandExecutor implements PoolableRemoteCommandExecuto
protected void buildConnection() throws IOException {
Connection conn = new Connection(getConfig().getRemoteHost(), getConfig().getPort());
conn.connect();
boolean isAuthenticated = conn.authenticateWithPassword(getConfig().getUser(), getConfig().getPsword());
boolean isAuthenticated = false;
if (!conn.isAuthenticationComplete()) {
if (Constants.SSH_AUTH_MODE_KEY.equalsIgnoreCase(getConfig().getAuthMode())) {
isAuthenticated = conn.authenticateWithPublicKey(getConfig().getUser(),
getConfig().getPsword().toCharArray(), null);
} else {
isAuthenticated = conn.authenticateWithPassword(getConfig().getUser(), getConfig().getPsword());
}
} else {
isAuthenticated = true;
}
if (!isAuthenticated) {
if (conn != null) {
conn.close();
......
......@@ -123,6 +123,10 @@ public class EntityDataCenterService {
protected Map<String, Object> convertDynamicEntityValueDto(DynamicEntityValueDto entityValueDto) {
Map<String, Object> targetEntityValueAsMap = new HashMap<>();
targetEntityValueAsMap.put("id", entityValueDto.getOid());
targetEntityValueAsMap.put("dataId", entityValueDto.getEntityDataId());
targetEntityValueAsMap.put("displayName", entityValueDto.getEntityDisplayName());
List<DynamicEntityAttrValueDto> attrValues = entityValueDto.getAttrValues();
if (attrValues == null || attrValues.isEmpty()) {
return targetEntityValueAsMap;
......
......@@ -56,6 +56,9 @@ import com.webank.wecube.platform.core.entity.plugin.PluginPackageRuntimeResourc
import com.webank.wecube.platform.core.entity.plugin.PluginPackageRuntimeResourcesMysql;
import com.webank.wecube.platform.core.entity.plugin.PluginPackageRuntimeResourcesS3;
import com.webank.wecube.platform.core.entity.plugin.PluginPackages;
import com.webank.wecube.platform.core.entity.plugin.ResourceS3AdditionalProperties;
import com.webank.wecube.platform.core.entity.plugin.ResourceS3FileInfo;
import com.webank.wecube.platform.core.entity.plugin.ResourceS3FileSetInfo;
import com.webank.wecube.platform.core.entity.plugin.SystemVariables;
import com.webank.wecube.platform.core.parser.PluginConfigXmlValidator;
import com.webank.wecube.platform.core.parser.PluginPackageDataModelValidator;
......@@ -84,6 +87,8 @@ import com.webank.wecube.platform.core.service.plugin.xml.register.AuthorityType
import com.webank.wecube.platform.core.service.plugin.xml.register.DataModelType;
import com.webank.wecube.platform.core.service.plugin.xml.register.DockerType;
import com.webank.wecube.platform.core.service.plugin.xml.register.EntityType;
import com.webank.wecube.platform.core.service.plugin.xml.register.FileSetType;
import com.webank.wecube.platform.core.service.plugin.xml.register.FileType;
import com.webank.wecube.platform.core.service.plugin.xml.register.InputParameterType;
import com.webank.wecube.platform.core.service.plugin.xml.register.InputParametersType;
import com.webank.wecube.platform.core.service.plugin.xml.register.InterfaceType;
......@@ -107,6 +112,7 @@ import com.webank.wecube.platform.core.service.plugin.xml.register.SystemParamet
import com.webank.wecube.platform.core.service.user.UserManagementService;
import com.webank.wecube.platform.core.utils.Constants;
import com.webank.wecube.platform.core.utils.JaxbUtils;
import com.webank.wecube.platform.core.utils.JsonUtils;
import com.webank.wecube.platform.core.utils.SystemUtils;
import com.webank.wecube.platform.workflow.commons.LocalIdGenerator;
......@@ -442,6 +448,7 @@ public class PluginArtifactsMgmtService extends AbstractPluginMgmtService {
pluginPackagesMapper.insert(pluginPackageEntity);
processPluginUiPackageFile(localFilePath, xmlPackage, pluginPackageEntity);
processS3BucketFiles(localFilePath, xmlPackage, pluginPackageEntity);
// trySavePluginPackageResourceFiles(pluginPackageResourceFilesEntities);
......@@ -472,6 +479,59 @@ public class PluginArtifactsMgmtService extends AbstractPluginMgmtService {
return result;
}
//TODO
protected void processS3BucketFiles(File localFilePath, PackageType xmlPackage, PluginPackages pluginPackageEntity) {
ResourceDependenciesType xmlResourceDependenciesType = xmlPackage.getResourceDependencies();
if(xmlResourceDependenciesType == null) {
return;
}
List<S3Type> xmlS3List = xmlResourceDependenciesType.getS3();
if (xmlS3List != null) {
for (S3Type xmlS3 : xmlS3List) {
FileSetType xmlFileSet = xmlS3.getFileSet();
if(xmlFileSet == null) {
continue;
}
List<FileType> xmlFiles = xmlFileSet.getFile();
if(xmlFiles == null || xmlFiles.isEmpty()) {
continue;
}
for(FileType xmlFile : xmlFiles) {
//TODO to tidy source path
String sourcePath = xmlFile.getSource();
if(StringUtils.isBlank(sourcePath)) {
continue;
}
if(sourcePath.startsWith("/")) {
sourcePath = sourcePath.substring(1);
}
File s3File = new File(localFilePath, sourcePath);
log.debug("s3 file: {}", s3File.getAbsolutePath());
String keyName = xmlPackage.getName() + "/" + xmlPackage.getVersion() + "/" + sourcePath;
log.debug("keyName : {}", keyName);
String s3FileUrl = s3Client.uploadFile(pluginProperties.getPluginPackageBucketName(), keyName,
s3File);
log.debug("s3FileUrl : {}", s3FileUrl);
}
}
}
//1 try check bucket if exists
//2 try create or retrieve bucket
//3 upload declared files
//4 store in database
}
protected UploadPackageResultDto performUploadPackage(MultipartFile pluginPackageFile, File localFilePath) {
String pluginPackageFileName = pluginPackageFile.getName();
......@@ -648,6 +708,12 @@ public class PluginArtifactsMgmtService extends AbstractPluginMgmtService {
s3Entity.setId(LocalIdGenerator.generateId());
s3Entity.setPluginPackageId(pluginPackageEntity.getId());
s3Entity.setBucketName(xmlS3.getBucketName());
String additionalPropsStr = buildXmlAdditionalProperties(xmlS3);
if(StringUtils.isNoneBlank(additionalPropsStr)) {
s3Entity.setAdditionalProperties(additionalPropsStr);
}
pluginPackageRuntimeResourcesS3Mapper.insert(s3Entity);
......@@ -655,6 +721,34 @@ public class PluginArtifactsMgmtService extends AbstractPluginMgmtService {
}
}
}
private String buildXmlAdditionalProperties(S3Type xmlS3) {
FileSetType xmlFileSet = xmlS3.getFileSet();
if(xmlFileSet == null) {
return null;
}
ResourceS3FileSetInfo fileSetInfo = new ResourceS3FileSetInfo();
ResourceS3AdditionalProperties additionalProps = new ResourceS3AdditionalProperties();
additionalProps.setFileSet(fileSetInfo);
List<FileType> xmlFiles = xmlFileSet.getFile();
if(xmlFiles != null) {
for(FileType xmlFile : xmlFiles) {
ResourceS3FileInfo fileInfo = new ResourceS3FileInfo();
fileInfo.setSource(xmlFile.getSource());
fileInfo.setToFile(xmlFile.getToFile());
fileSetInfo.getFiles().add(fileInfo);
}
}
String additionalPropsStr = JsonUtils.toJsonString(additionalProps);
return additionalPropsStr;
}
private void processDataModels(DataModelType xmlDataModel, PackageType xmlPackage,
PluginPackages pluginPackageEntity) {
......
......@@ -31,6 +31,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import com.webank.wecube.platform.core.commons.ApplicationProperties.ResourceProperties;
import com.webank.wecube.platform.core.commons.WecubeCoreException;
......@@ -47,6 +48,9 @@ import com.webank.wecube.platform.core.entity.plugin.PluginPackageRuntimeResourc
import com.webank.wecube.platform.core.entity.plugin.PluginPackageRuntimeResourcesS3;
import com.webank.wecube.platform.core.entity.plugin.PluginPackages;
import com.webank.wecube.platform.core.entity.plugin.ResourceItem;
import com.webank.wecube.platform.core.entity.plugin.ResourceS3AdditionalProperties;
import com.webank.wecube.platform.core.entity.plugin.ResourceS3FileInfo;
import com.webank.wecube.platform.core.entity.plugin.ResourceS3FileSetInfo;
import com.webank.wecube.platform.core.entity.plugin.ResourceServer;
import com.webank.wecube.platform.core.entity.plugin.SystemVariables;
import com.webank.wecube.platform.core.propenc.RsaEncryptor;
......@@ -59,15 +63,18 @@ import com.webank.wecube.platform.core.repository.plugin.PluginPackageRuntimeRes
import com.webank.wecube.platform.core.repository.plugin.PluginPackagesMapper;
import com.webank.wecube.platform.core.repository.plugin.ResourceItemMapper;
import com.webank.wecube.platform.core.repository.plugin.ResourceServerMapper;
import com.webank.wecube.platform.core.service.cmder.ssh2.RemoteCommandExecutorConfig;
import com.webank.wecube.platform.core.service.resource.ResourceItemType;
import com.webank.wecube.platform.core.service.resource.ResourceManagementService;
import com.webank.wecube.platform.core.service.resource.ResourceServerType;
import com.webank.wecube.platform.core.support.RealS3Client;
import com.webank.wecube.platform.core.support.authserver.AuthServerRestClient;
import com.webank.wecube.platform.core.support.authserver.SimpleSubSystemDto;
import com.webank.wecube.platform.core.support.gateway.GatewayResponse;
import com.webank.wecube.platform.core.support.gateway.GatewayServiceStub;
import com.webank.wecube.platform.core.support.gateway.RegisterRouteItemsDto;
import com.webank.wecube.platform.core.support.gateway.RouteItem;
import com.webank.wecube.platform.core.utils.Constants;
import com.webank.wecube.platform.core.utils.EncryptionUtils;
import com.webank.wecube.platform.core.utils.JsonUtils;
import com.webank.wecube.platform.core.utils.StringUtilsEx;
......@@ -83,7 +90,7 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
private static final int PLUGIN_DEFAULT_START_PORT = 20000;
private static final int PLUGIN_DEFAULT_END_PORT = 30000;
private static final String INIT_VECTOR = "encriptionVector";
@Autowired
......@@ -133,6 +140,8 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
@Autowired
private PluginCertificationMapper pluginCertificationMapper;
private ObjectMapper objectMapper = new ObjectMapper();
public void removePluginInstanceById(String instanceId) throws Exception {
log.info("Removing plugin instance,instanceId: {}", instanceId);
PluginInstances pluginInstanceEntity = pluginInstancesMapper.selectByPrimaryKey(instanceId);
......@@ -202,9 +211,9 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
}
// 2. try to create s3 bucket
String s3BucketResourceId = handleCreateS3Bucket(s3InfoSet, pluginPackage);
if (s3BucketResourceId != null) {
pluginInstanceEntity.setS3bucketResourceId(s3BucketResourceId);
ResourceItem s3BucketResourceItem = handleCreateS3Bucket(s3InfoSet, pluginPackage);
if (s3BucketResourceItem != null) {
pluginInstanceEntity.setS3bucketResourceId(s3BucketResourceItem.getId());
}
// 3. create docker instance
......@@ -224,12 +233,8 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
if (mysqlInfoSet.size() != 0) {
String password = dbInfo.getPassword();
if (password.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
password = password.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length());
}
password = EncryptionUtils.decryptWithAes(password, resourceProperties.getPasswordEncryptionSeed(),
dbInfo.getSchema());
password = EncryptionUtils.decryptAesPrefixedStringForcely(password,
resourceProperties.getPasswordEncryptionSeed(), dbInfo.getSchema());
envVariablesString = envVariablesString.replace("{{DB_HOST}}", dbInfo.getHost()) //
.replace("{{DB_PORT}}", dbInfo.getPort()) //
......@@ -308,14 +313,13 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
String aesKey = UUID.randomUUID().toString().replace("-", "").substring(0, 16);
String initVector = INIT_VECTOR;
String licenseCode = aesKey+initVector;
String rsaEncryptedAesKey = RsaEncryptor.encodeBase64String(
RsaEncryptor.encryptByPublicKey(licenseCode.getBytes(Charset.forName("UTF-8")), subSystemAsDto.getPubKey()));
String licenseCode = aesKey + initVector;
String rsaEncryptedAesKey = RsaEncryptor.encodeBase64String(RsaEncryptor
.encryptByPublicKey(licenseCode.getBytes(Charset.forName("UTF-8")), subSystemAsDto.getPubKey()));
String lpk = pluginCertification.getLpk();
String encryptData = pluginCertification.getEncryptData();
String signature = pluginCertification.getSignature();
String aesEncryptedLpk = "";
if (StringUtils.isNoneBlank(lpk)) {
......@@ -402,14 +406,18 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
log.info("scp from local:{} to remote: {}", tmpFilePath, pluginProperties.getPluginDeployPath());
try {
String dbPassword = hostInfo.getLoginPassword();
if (dbPassword.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
dbPassword = dbPassword.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length());
}
String password = EncryptionUtils.decryptWithAes(dbPassword, resourceProperties.getPasswordEncryptionSeed(),
hostInfo.getName());
scpService.put(hostIp, Integer.valueOf(hostInfo.getPort()), hostInfo.getLoginUsername(), password,
tmpFilePath, pluginProperties.getPluginDeployPath());
String password = EncryptionUtils.decryptAesPrefixedStringForcely(dbPassword,
resourceProperties.getPasswordEncryptionSeed(), hostInfo.getName());
RemoteCommandExecutorConfig sshConfig = new RemoteCommandExecutorConfig();
sshConfig.setAuthMode(hostInfo.getLoginMode());
sshConfig.setPort(Integer.valueOf(hostInfo.getPort()));
sshConfig.setPsword(password);
sshConfig.setRemoteHost(hostIp);
sshConfig.setUser(hostInfo.getLoginUsername());
scpService.put(sshConfig, tmpFilePath, pluginProperties.getPluginDeployPath());
} catch (Exception e) {
log.error("Put file to remote host meet error", e);
throw new WecubeCoreException("3085",
......@@ -422,13 +430,18 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
log.info("Run docker load command: " + loadCmd);
try {
String loginPassword = hostInfo.getLoginPassword();
if (loginPassword.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
loginPassword = EncryptionUtils.decryptWithAes(
loginPassword.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length()),
resourceProperties.getPasswordEncryptionSeed(), hostInfo.getName());
}
commandService.runAtRemote(hostIp, hostInfo.getLoginUsername(), loginPassword,
Integer.valueOf(hostInfo.getPort()), loadCmd);
loginPassword = EncryptionUtils.decryptAesPrefixedStringOnly(loginPassword,
resourceProperties.getPasswordEncryptionSeed(), hostInfo.getName());
RemoteCommandExecutorConfig sshConfig = new RemoteCommandExecutorConfig();
sshConfig.setAuthMode(hostInfo.getLoginMode());
sshConfig.setPort(Integer.valueOf(hostInfo.getPort()));
sshConfig.setPsword(loginPassword);
sshConfig.setRemoteHost(hostIp);
sshConfig.setUser(hostInfo.getLoginUsername());
commandService.runAtRemote(sshConfig, loadCmd);
} catch (Exception e) {
log.error("Run command [{}] meet error: {}", loadCmd, e.getMessage());
throw new WecubeCoreException("3086", String.format("Run remote command meet error: %s", e.getMessage()),
......@@ -543,8 +556,10 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
return systemVariableService.variableReplacement(packageName, str);
}
private String handleCreateS3Bucket(List<PluginPackageRuntimeResourcesS3> s3ResourceInfoList,
private ResourceItem handleCreateS3Bucket(List<PluginPackageRuntimeResourcesS3> s3ResourceInfoList,
PluginPackages pluginPackage) {
// TODO
if (s3ResourceInfoList == null || s3ResourceInfoList.isEmpty()) {
return null;
}
......@@ -558,18 +573,120 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
List<ResourceItem> s3BucketsItemEntities = resourceItemMapper
.selectAllByNameAndType(s3ResourceInfo.getBucketName(), ResourceItemType.S3_BUCKET.getCode());
// TODO
ResourceItem s3ResItem = null;
if (s3BucketsItemEntities.size() > 0) {
return s3BucketsItemEntities.get(0).getId();
s3ResItem = s3BucketsItemEntities.get(0);
} else {
return initS3BucketResource(s3ResourceInfo);
s3ResItem = initS3BucketResource(s3ResourceInfo);
}
ResourceServer resServer = resourceServerMapper.selectByPrimaryKey(s3ResItem.getResourceServerId());
s3ResItem.setResourceServer(resServer);
// TODO to process s3 files
processprocessS3BucketFiles(pluginPackage, s3ResourceInfo, s3ResItem, resServer);
return s3ResItem;
}
private void processprocessS3BucketFiles(PluginPackages pluginPackage,
PluginPackageRuntimeResourcesS3 s3ResourceInfo, ResourceItem s3ResItem, ResourceServer resServer) {
String additionalProperties = s3ResourceInfo.getAdditionalProperties();
if (StringUtils.isBlank(additionalProperties)) {
return;
}
ResourceS3AdditionalProperties additionalProps = convertFromJson(additionalProperties);
if (additionalProps == null) {
return;
}
ResourceS3FileSetInfo fileSet = additionalProps.getFileSet();
if (fileSet == null) {
return;
}
List<ResourceS3FileInfo> fileInfos = fileSet.getFiles();
if (fileInfos == null || fileInfos.isEmpty()) {
return;
}
for (ResourceS3FileInfo fileInfo : fileInfos) {
processprocessS3BucketFile(pluginPackage, s3ResourceInfo, s3ResItem, resServer, fileInfo);
}
}
private String initS3BucketResource(PluginPackageRuntimeResourcesS3 s3ResourceInfo) {
private void processprocessS3BucketFile(PluginPackages pluginPackage,
PluginPackageRuntimeResourcesS3 s3ResourceInfo, ResourceItem s3ResItem, ResourceServer resServer,
ResourceS3FileInfo fileInfo) {
log.debug("try to process:{}", fileInfo);
if (StringUtils.isBlank(fileInfo.getSource())) {
return;
}
if (StringUtils.isBlank(fileInfo.getToFile())) {
return;
}
String sourceFileName = stripLeadingSlash(fileInfo.getSource());
String toFileName = stripLeadingSlash(fileInfo.getToFile());
String tmpFolderName = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
String tmpFilePath = SystemUtils.getTempFolderPath() + tmpFolderName + "/" + sourceFileName;
String s3KeyName = pluginPackage.getName() + "/" + pluginPackage.getVersion() + "/" + sourceFileName;
log.info("Download plugin package from S3: {}", s3KeyName);
s3Client.downFile(pluginProperties.getPluginPackageBucketName(), s3KeyName, tmpFilePath);
File toUploadFile = new File(tmpFilePath);
log.debug("s3 file: {}", toUploadFile.getAbsolutePath());
String keyName = toFileName;
log.debug("keyName : {}", keyName);
String dbPassword = resServer.getLoginPassword();
String password = EncryptionUtils.decryptAesPrefixedStringForcely(dbPassword,
resourceProperties.getPasswordEncryptionSeed(), resServer.getName());
String endPoint = String.format("http://%s:%s", resServer.getHost(), resServer.getPort());
RealS3Client amazonS3Client = new RealS3Client(endPoint, resServer.getLoginUsername(), password);
String s3FileUrl = amazonS3Client.uploadFile(s3ResItem.getName(), keyName, toUploadFile);
log.debug("s3FileUrl : {}", s3FileUrl);
}
private String stripLeadingSlash(String s) {
if (s.startsWith("/")) {
return s.substring(1);
} else {
return s;
}
}
private ResourceS3AdditionalProperties convertFromJson(String json) {
try {
ResourceS3AdditionalProperties additionalProps = objectMapper.readValue(json,
ResourceS3AdditionalProperties.class);
return additionalProps;
} catch (Exception e) {
log.error("Errors while reading json data.", e);
throw new WecubeCoreException(e.getMessage());
}
}
private ResourceItem initS3BucketResource(PluginPackageRuntimeResourcesS3 s3ResourceInfo) {
return createPluginS3Bucket(s3ResourceInfo);
}
private String createPluginS3Bucket(PluginPackageRuntimeResourcesS3 s3ResourceInfo) {
// TODO
private ResourceItem createPluginS3Bucket(PluginPackageRuntimeResourcesS3 s3ResourceInfo) {
QueryRequestDto queryRequest = QueryRequestDto.defaultQueryObject("type", ResourceServerType.S3.getCode());
List<ResourceServerDto> s3Servers = resourceManagementService.retrieveServers(queryRequest).getContents();
if (s3Servers.size() == 0) {
......@@ -594,7 +711,10 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
return null;
}
log.info("S3 bucket creation has done...");
return resultResourceItemDtos.get(0).getId();
ResourceItemDto resItemDto = resultResourceItemDtos.get(0);
ResourceItem resItem = resourceItemMapper.selectByPrimaryKey(resItemDto.getId());
return resItem;
}
private LocalDatabaseInfo handleCreateDatabase(List<PluginPackageRuntimeResourcesMysql> mysqlInfoResourceEntities,
......@@ -697,12 +817,9 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
s3Client.downFile(pluginProperties.getPluginPackageBucketName(), s3KeyName, initSqlPath);
String password = mysqlInstance.getPassword();
if (password.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
password = password.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length());
}
password = EncryptionUtils.decryptWithAes(password, resourceProperties.getPasswordEncryptionSeed(),
mysqlInstance.getSchemaName());
password = EncryptionUtils.decryptAesPrefixedStringForcely(password,
resourceProperties.getPasswordEncryptionSeed(), mysqlInstance.getSchemaName());
DriverManagerDataSource dataSource = new DriverManagerDataSource(
"jdbc:mysql://" + dbServer.getHost() + ":" + dbServer.getPort() + "/" + mysqlInstance.getSchemaName()
......@@ -759,7 +876,7 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
log.info("Request parameters= " + createMysqlDto);
}
dbPassword = ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX + EncryptionUtils.encryptWithAes(dbPassword,
dbPassword = Constants.PASSWORD_ENCRYPT_AES_PREFIX + EncryptionUtils.encryptWithAes(dbPassword,
resourceProperties.getPasswordEncryptionSeed(), mysqlResourceInfo.getSchemaName());
List<ResourceItemDto> result = resourceManagementService.createItems(Lists.newArrayList(createMysqlDto));
......@@ -843,15 +960,10 @@ public class PluginInstanceMgmtService extends AbstractPluginMgmtService {
s3Client.downFile(pluginProperties.getPluginPackageBucketName(), s3KeyName, initSqlPath);
// ResourceServerDomain dbServer =
// resourceItemRepository.findById(mysqlInstance.getResourceItemId()).get()
// .getResourceServer();
String password = mysqlInstance.getPassword();
if (password.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
password = password.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length());
}
password = EncryptionUtils.decryptWithAes(password, resourceProperties.getPasswordEncryptionSeed(),
mysqlInstance.getSchemaName());
password = EncryptionUtils.decryptAesPrefixedStringForcely(password,
resourceProperties.getPasswordEncryptionSeed(), mysqlInstance.getSchemaName());
DriverManagerDataSource dataSource = new DriverManagerDataSource(
"jdbc:mysql://" + resourceServer.getHost() + ":" + resourceServer.getPort() + "/"
+ mysqlInstance.getSchemaName() + "?characterEncoding=utf8&serverTimezone=UTC",
......
......@@ -2,6 +2,7 @@ package com.webank.wecube.platform.core.service.plugin;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
......@@ -68,6 +69,7 @@ import com.webank.wecube.platform.core.repository.plugin.PluginPackageRuntimeRes
import com.webank.wecube.platform.core.repository.plugin.PluginPackageRuntimeResourcesMysqlMapper;
import com.webank.wecube.platform.core.repository.plugin.PluginPackageRuntimeResourcesS3Mapper;
import com.webank.wecube.platform.core.repository.plugin.PluginPackagesMapper;
import com.webank.wecube.platform.core.service.cmder.ssh2.RemoteCommandExecutorConfig;
import com.webank.wecube.platform.core.service.user.RoleMenuService;
import com.webank.wecube.platform.core.support.authserver.AsAuthorityDto;
import com.webank.wecube.platform.core.support.authserver.AsRoleAuthoritiesDto;
......@@ -969,10 +971,27 @@ public class PluginPackageMgmtService extends AbstractPluginMgmtService {
try {
List<String> staticResourceIps = StringUtilsEx
.splitByComma(pluginProperties.getStaticResourceServerIp());
String authMode = pluginProperties.getStaticResourceServerAuthMode();
if(StringUtils.isBlank(authMode)) {
authMode = Constants.SSH_AUTH_MODE_PASSWORD;
}
String passwd = pluginProperties.getStaticResourceServerPassword();
if(Constants.SSH_AUTH_MODE_KEY.equalsIgnoreCase(authMode)) {
passwd = readStaticResourceRsaKey(pluginProperties.getStaticResourceServerKeyPath());
}
for (String staticResourceIp : staticResourceIps) {
commandService.runAtRemote(staticResourceIp, pluginProperties.getStaticResourceServerUser(),
pluginProperties.getStaticResourceServerPassword(),
pluginProperties.getStaticResourceServerPort(), mkdirCmd);
RemoteCommandExecutorConfig sshConfig = new RemoteCommandExecutorConfig();
sshConfig.setAuthMode(authMode);
sshConfig.setPort(pluginProperties.getStaticResourceServerPort());
sshConfig.setPsword(passwd);
sshConfig.setRemoteHost(staticResourceIp);
sshConfig.setUser(pluginProperties.getStaticResourceServerUser());
commandService.runAtRemote(sshConfig, mkdirCmd);
}
} catch (Exception e) {
log.error("errors while remove plugin resources:{}", remotePath, e);
......@@ -982,6 +1001,15 @@ public class PluginPackageMgmtService extends AbstractPluginMgmtService {
}
}
}
private String readStaticResourceRsaKey(String path) {
try {
return FileUtils.readFileToString(new File(path), Charset.forName("UTF-8"));
} catch (IOException e) {
log.error("", e);
throw new WecubeCoreException(e.getMessage());
}
}
private void removeLocalDockerImageFiles(PluginPackages pluginPackage) {
// Remove related docker image file
......@@ -1075,17 +1103,34 @@ public class PluginPackageMgmtService extends AbstractPluginMgmtService {
// get all static resource hosts
List<String> staticResourceIps = StringUtilsEx.splitByComma(pluginProperties.getStaticResourceServerIp());
String authMode = pluginProperties.getStaticResourceServerAuthMode();
if(StringUtils.isBlank(authMode)) {
authMode = Constants.SSH_AUTH_MODE_PASSWORD;
}
String passwd = pluginProperties.getStaticResourceServerPassword();
if(Constants.SSH_AUTH_MODE_KEY.equalsIgnoreCase(authMode)) {
passwd = readStaticResourceRsaKey(pluginProperties.getStaticResourceServerKeyPath());
}
for (String remoteIp : staticResourceIps) {
RemoteCommandExecutorConfig sshConfig = new RemoteCommandExecutorConfig();
sshConfig.setAuthMode(authMode);
sshConfig.setPort(pluginProperties.getStaticResourceServerPort());
sshConfig.setPsword(passwd);
sshConfig.setRemoteHost(remoteIp);
sshConfig.setUser(pluginProperties.getStaticResourceServerUser());
// mkdir at remote host
if (!remotePath.equals("/") && !remotePath.equals(".")) {
String mkdirCmd = String.format("rm -rf %s && mkdir -p %s", remotePath, remotePath);
try {
commandService.runAtRemote(remoteIp, pluginProperties.getStaticResourceServerUser(),
pluginProperties.getStaticResourceServerPassword(),
pluginProperties.getStaticResourceServerPort(), mkdirCmd);
commandService.runAtRemote(sshConfig, mkdirCmd);
} catch (Exception e) {
log.error("Run command [mkdir] meet error: ", e.getMessage());
throw new WecubeCoreException("3110",
......@@ -1096,9 +1141,7 @@ public class PluginPackageMgmtService extends AbstractPluginMgmtService {
// scp UI.zip to Static Resource Server
try {
log.info("Scp files from {} to {}", tmpDownloadUiZipPath, remotePath);
scpService.put(remoteIp, pluginProperties.getStaticResourceServerPort(),
pluginProperties.getStaticResourceServerUser(),
pluginProperties.getStaticResourceServerPassword(), tmpDownloadUiZipPath, remotePath);
scpService.put(sshConfig, tmpDownloadUiZipPath, remotePath);
} catch (Exception e) {
log.error("errors to remotely copy file to :{}", remoteIp, e);
throw new WecubeCoreException("3111",
......@@ -1110,9 +1153,7 @@ public class PluginPackageMgmtService extends AbstractPluginMgmtService {
String unzipCmd = String.format("cd %s && unzip %s", remotePath, pluginProperties.getUiFile());
try {
log.info("To run ssh command at remote:{}", unzipCmd);
commandService.runAtRemote(remoteIp, pluginProperties.getStaticResourceServerUser(),
pluginProperties.getStaticResourceServerPassword(),
pluginProperties.getStaticResourceServerPort(), unzipCmd);
commandService.runAtRemote(sshConfig, unzipCmd);
} catch (Exception e) {
log.error("errors to remotely execute command :{}", unzipCmd, e);
log.error("Run command [unzip] meet error: ", e.getMessage());
......
package com.webank.wecube.platform.core.service.plugin.xml.register;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "fileSetType", propOrder = {
"file"
})
public class FileSetType {
protected List<FileType> file;
public List<FileType> getFile() {
if (file == null) {
file = new ArrayList<FileType>();
}
return this.file;
}
}
package com.webank.wecube.platform.core.service.plugin.xml.register;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "fileType", propOrder = {
"source","toFile"
})
public class FileType {
@XmlAttribute(name = "source", required = true)
protected String source;
@XmlAttribute(name = "toFile", required = true)
protected String toFile;
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getToFile() {
return toFile;
}
public void setToFile(String toFile) {
this.toFile = toFile;
}
}
......@@ -11,8 +11,8 @@ package com.webank.wecube.platform.core.service.plugin.xml.register;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
......@@ -34,38 +34,15 @@ import javax.xml.bind.annotation.XmlValue;
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "s3Type", propOrder = {
"value"
"bucketName","fileSet"
})
public class S3Type {
@XmlValue
protected String value;
@XmlAttribute(name = "bucketName", required = true)
protected String bucketName;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
@XmlElement(name = "fileSet", required = false)
protected FileSetType fileSet;
/**
* Gets the value of the bucketName property.
......@@ -91,4 +68,13 @@ public class S3Type {
this.bucketName = value;
}
public FileSetType getFileSet() {
return fileSet;
}
public void setFileSet(FileSetType fileSet) {
this.fileSet = fileSet;
}
}
......@@ -57,17 +57,12 @@ public class MysqlAccountManagementService implements ResourceItemService {
DriverManagerDataSource dataSource = newDatasource(item);
try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement();) {
log.info("password before decrypt={}", password);
String rawPassword = null;
if (password.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
password = password.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length());
}
rawPassword = EncryptionUtils.decryptWithAes(
String plainPassword = EncryptionUtils.decryptAesPrefixedStringForcely(
password,
resourceProperties.getPasswordEncryptionSeed(), item.getName());
statement.executeUpdate(String.format("CREATE USER `%s` IDENTIFIED BY '%s'", username, rawPassword));
statement.executeUpdate(String.format("CREATE USER `%s` IDENTIFIED BY '%s'", username, plainPassword));
statement.executeUpdate(String.format("GRANT ALL ON %s.* TO %s@'%%' IDENTIFIED BY '%s'", item.getName(),
username, rawPassword));
username, plainPassword));
} catch (Exception e) {
String errorMessage = String.format("Failed to create account [username = %s]", username);
log.error(errorMessage, e);
......@@ -92,11 +87,8 @@ public class MysqlAccountManagementService implements ResourceItemService {
String password;
try {
String dbPassword = item.getResourceServer().getLoginPassword();
if (dbPassword.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
dbPassword = dbPassword.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length());
}
password = EncryptionUtils.decryptWithAes(
password = EncryptionUtils.decryptAesPrefixedStringForcely(
dbPassword,
resourceProperties.getPasswordEncryptionSeed(), item.getResourceServer().getName());
} catch (Exception e) {
......
......@@ -52,11 +52,8 @@ public class MysqlDatabaseManagementService implements ResourceItemService {
private DriverManagerDataSource newDatasource(ResourceItem item) {
String password = item.getResourceServer().getLoginPassword();
if (password.startsWith(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX)) {
password = password.substring(ResourceManagementService.PASSWORD_ENCRYPT_AES_PREFIX.length());
}
password = EncryptionUtils.decryptWithAes(
password = EncryptionUtils.decryptAesPrefixedStringForcely(
password,
resourceProperties.getPasswordEncryptionSeed(), item.getResourceServer().getName());
DriverManagerDataSource dataSource = newMysqlDatasource(item.getResourceServer().getHost(),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment