添加主机身份页面.

This commit is contained in:
lijiahang
2023-09-21 13:50:42 +08:00
parent fbc40116f0
commit b13cbd8cca
39 changed files with 444 additions and 649 deletions

View File

@@ -21,6 +21,8 @@ public interface ErrorMessage {
String DATA_ABSENT = "数据不存在";
String KEY_ABSENT = "秘钥不存在";
String CONFIG_ABSENT = "配置不存在";
String DATA_PRESENT = "数据已存在";

View File

@@ -0,0 +1,40 @@
package com.orion.ops.framework.common.security;
import com.orion.lang.utils.Booleans;
import com.orion.lang.utils.Strings;
import com.orion.ops.framework.common.constant.Const;
import com.orion.ops.framework.common.utils.CryptoUtils;
/**
* 密码修改器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/21 11:35
*/
public class PasswordModifier {
private PasswordModifier() {
}
/**
* 获取新密码
*
* @param action action
* @return password
*/
public static String getEncryptNewPassword(UpdatePasswordAction action) {
if (Booleans.isTrue(action.getUseNewPassword())) {
// 使用新密码
String password = action.getPassword();
if (Strings.isBlank(password)) {
return Const.EMPTY;
} else {
return CryptoUtils.encryptAsString(password);
}
} else {
return null;
}
}
}

View File

@@ -0,0 +1,28 @@
package com.orion.ops.framework.common.security;
import java.io.Serializable;
/**
* 更新密码操作
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/21 11:32
*/
public interface UpdatePasswordAction extends Serializable {
/**
* 是否使用新密码
*
* @return use
*/
Boolean getUseNewPassword();
/**
* 获取密码
*
* @return password
*/
String getPassword();
}