mirror of https://gitee.com/stylefeng/roses
【8.0】【auth】更新配置密码策略
parent
16fb4b4d63
commit
feaa59020c
|
@ -11,19 +11,6 @@ import cn.stylefeng.roses.kernel.config.api.context.ConfigContext;
|
|||
*/
|
||||
public class LoginConfigExpander {
|
||||
|
||||
/**
|
||||
* 登录账号密码登录最大的错误次数
|
||||
* <p>
|
||||
* 超过此次数则冻结账号
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/10/3 20:25
|
||||
*/
|
||||
public static Integer getMaxErrorLoginCount() {
|
||||
return ConfigContext.me()
|
||||
.getSysConfigValueWithDefault("SYS_LOGIN_MAX_ERROR_LOGIN_COUNT", Integer.class, LoginCacheConstants.MAX_ERROR_LOGIN_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单账号单端登录的开关
|
||||
* <p>
|
||||
|
@ -50,7 +37,20 @@ public class LoginConfigExpander {
|
|||
}
|
||||
|
||||
/**
|
||||
* 口令最小长度
|
||||
* 密码策略:密码最大重试次数
|
||||
* <p>
|
||||
* 超过此次数则冻结账号
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/10/3 20:25
|
||||
*/
|
||||
public static Integer getMaxErrorLoginCount() {
|
||||
return ConfigContext.me()
|
||||
.getSysConfigValueWithDefault("SYS_LOGIN_MAX_ERROR_LOGIN_COUNT", Integer.class, LoginCacheConstants.MAX_ERROR_LOGIN_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码策略:口令最小长度
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/10/3 20:39
|
||||
|
@ -59,4 +59,44 @@ public class LoginConfigExpander {
|
|||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_MIN_PASSWORD_LENGTH", Integer.class, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码策略:最少特殊符号数量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/10/3 20:44
|
||||
*/
|
||||
public static Integer getPasswordMinSpecialSymbolCount() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_SPECIAL_SYMBOL_COUNT", Integer.class, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码策略:最少大写字母数量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/10/3 21:14
|
||||
*/
|
||||
public static Integer getPasswordMinUpperCaseCount() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_UPPER_CASE_COUNT", Integer.class, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码策略:最少小写字母数量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/10/3 21:16
|
||||
*/
|
||||
public static Integer getPasswordMinLowerCaseCount() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_LOWER_CASE_COUNT", Integer.class, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码策略:最少数字符号的数量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/10/3 21:18
|
||||
*/
|
||||
public static Integer getPasswordMinNumberCount() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_NUMBER_COUNT", Integer.class, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709185484166533121, '密码最大重试次数', 'SYS_LOGIN_MAX_ERROR_LOGIN_COUNT', '5', 'Y', '登录账号密码登录最大的错误次数,超过此次数则冻结账号', 1, 'auth_config', 'N', '2023-10-03 20:35:49', 1339550467939639299, '2023-10-03 20:35:58', 1339550467939639299);
|
||||
INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709186904454336514, '口令最小长度', 'SYS_LOGIN_MIN_PASSWORD_LENGTH', '6', 'Y', NULL, 1, 'auth_config', 'N', '2023-10-03 20:41:28', 1339550467939639299, NULL, NULL);
|
||||
INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709186904454336514, '密码策略:口令最小长度', 'SYS_LOGIN_MIN_PASSWORD_LENGTH', '6', 'Y', NULL, 1, 'auth_config', 'N', '2023-10-03 20:41:28', 1339550467939639299, NULL, NULL);
|
||||
INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709189854337699842, '密码策略:最少特殊符号数量', 'SYS_LOGIN_PASSWORD_MIN_SPECIAL_SYMBOL_COUNT', '0', 'Y', NULL, 1, 'auth_config', 'N', '2023-10-03 20:53:11', 1339550467939639299, '2023-10-03 21:19:56', 1339550467939639299);
|
||||
INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709196660577406977, '密码策略:最少大写字母数量', 'SYS_LOGIN_PASSWORD_MIN_UPPER_CASE_COUNT', '0', 'Y', NULL, 1, 'auth_config', 'N', '2023-10-03 21:20:14', 1339550467939639299, NULL, NULL);
|
||||
INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709196708086288385, '密码策略:最少小写字母数量', 'SYS_LOGIN_PASSWORD_MIN_LOWER_CASE_COUNT', '0', 'Y', NULL, 1, 'auth_config', 'N', '2023-10-03 21:20:25', 1339550467939639299, NULL, NULL);
|
||||
INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709196753862922241, '密码策略:最少数字符号的数量', 'SYS_LOGIN_PASSWORD_MIN_NUMBER_COUNT', '0', 'Y', NULL, 1, 'auth_config', 'N', '2023-10-03 21:20:36', 1339550467939639299, NULL, NULL);
|
||||
|
|
Loading…
Reference in New Issue