Browse Source

Pull request #2603: REPORT-38872 设计器https证书密码明文存储

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '67497aafeb05577b54e5759de3a052194d3814ab':
  REPORT-38872 修改下变量名
  REPORT-38872 设计器https证书密码明文存储
feature/big-screen
Hades 4 years ago
parent
commit
bb177b5a9c
  1. 17
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 16
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java

17
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -418,21 +418,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.isHttps = isHttps;
}
public String getCertificatePath() {
return certificatePath;
}
public void setCertificatePath(String certificatePath) {
this.certificatePath = certificatePath;
}
public String getCertificatePass() {
return certificatePass;
}
public void setCertificatePass(String certificatePass) {
this.certificatePass = certificatePass;
}
@ -2015,11 +2004,13 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private void writeHttpsParas(XMLPrintWriter writer) {
writer.startTAG(CAS_PARAS);
// 这边的密钥path和password没有用处了 当前已经全部储存在对应的WorkspaceConnectionInfo中
// 把历史遗留保存的全部置为空 防止显示明文密钥 后面删除 todo
if (StringUtils.isNotBlank(certificatePath)) {
writer.attr(CAS_CERTIFICATE_PATH, certificatePath);
writer.attr(CAS_CERTIFICATE_PATH, StringUtils.EMPTY);
}
if (StringUtils.isNotBlank(certificatePass)) {
writer.attr(CAS_CERTIFICATE_PASSWORD, certificatePass);
writer.attr(CAS_CERTIFICATE_PASSWORD, StringUtils.EMPTY);
}
if (isHttps) {
writer.attr("enable", true);

16
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -143,6 +143,12 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
* https 证书路径输入框
*/
private JPanel httpsCertFileInputPanel;
/**
* 当前远程工作目录是否为新创建的
*/
private boolean newCreated;
/**
* 主机名web应用Servlet端口监听器
*/
@ -327,7 +333,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
this.certPathInput.setText(certPath);
this.certSecretKeyInput.setText(certSecretKey);
this.rememberPwdCheckbox.setSelected(rememberPwd);
this.newCreated = ob.isNewCreated();
} else {
this.remoteWorkspaceURL = RemoteWorkspaceURL.createDefaultURL();
this.usernameInput.setText(StringUtils.EMPTY);
@ -335,6 +341,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
this.certPathInput.setText(StringUtils.EMPTY);
this.certSecretKeyInput.setText(StringUtils.EMPTY);
this.rememberPwdCheckbox.setSelected(true);
this.newCreated = true;
}
fillRemoteEnvURLField();
@ -366,7 +373,9 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
new String(this.certSecretKeyInput.getPassword()),
rememberPwd);
return RemoteDesignerWorkspaceInfo.create(connection);
RemoteDesignerWorkspaceInfo info = RemoteDesignerWorkspaceInfo.create(connection);
info.setNewCreated(newCreated);
return info;
}
@Override
@ -567,9 +576,6 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
@Override
protected TestConnectionResult doInBackground() throws Exception {
DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath());
DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey());
try {
return TestConnectionResult.parse(WorkContext.getConnector().testConnection(connection), connection);
} catch (WorkspaceAuthException ignored) {

Loading…
Cancel
Save