Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
enum ["utf8", "utf8mb4"]
hint "允许使用的字符集"

// 对于 alert 语句,只有当设置了 character set 选项时候才进行校验
// For alert statements, validate only when the character set option is set
if
@domain.sqlType in ['ALERT_CATALOG'] and
@func.string.isNotBlank(@domain.characterSet)
then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end

end

// 对于 create 语句,检测是否必须设置 character set 选项
// For create statements, check whether the character set option is required
if @domain.sqlType == 'CREATE_CATALOG' then

if cast(#{require} as bool) then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end
Expand All @@ -60,27 +60,27 @@ end
enum ["utf8_unicode_ci", "utf8mb4_unicode_ci"]
hint "允许使用的排序规则"

// 对于 alert 语句,只有当设置了 collate 选项时候才进行校验
// For alert statements, validate only when the collate option is set
if
@domain.sqlType in ['ALERT_CATALOG'] and
@func.string.isNotBlank(@domain.collate)
then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end

end

// 对于 create 语句,检测是否必须设置 collate 选项
// For create statements, check whether the collate option is required
if @domain.sqlType == 'CREATE_CATALOG' then

if cast(#{require} as bool) then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end
Expand Down Expand Up @@ -143,27 +143,27 @@ end
enum ["utf8", "utf8mb4"]
hint "允许使用的字符集"

// 对于 alter 语句,只有当设置了 character set 选项时候才进行校验
// For alter statements, validate only when the character set option is set
if
@domain.sqlType in ['ALTER_CATALOG'] and
@func.string.isNotBlank(@domain.characterSet)
then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end

end

// 对于 create 语句,检测是否必须设置 character set 选项
// For create statements, check whether the character set option is required
if @domain.sqlType == 'CREATE_CATALOG' then

if cast(#{require} as bool) then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end
Expand All @@ -190,27 +190,27 @@ end
enum ["utf8_unicode_ci", "utf8mb4_unicode_ci"]
hint "允许使用的排序规则"

// 对于 alter 语句,只有当设置了 collate 选项时候才进行校验
// For alter statements, validate only when the collate option is set
if
@domain.sqlType in ['ALTER_CATALOG'] and
@func.string.isNotBlank(@domain.collate)
then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end

end

// 对于 create 语句,检测是否必须设置 collate 选项
// For create statements, check whether the collate option is required
if @domain.sqlType == 'CREATE_CATALOG' then

if cast(#{require} as bool) then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end
Expand Down Expand Up @@ -330,7 +330,7 @@ if @func.string.isBlank(@domain.autoIncrement) then
else

if @func.string.isBlank(#{number}) then
return false // 规则配置错误
return false // Invalid rule configuration
else
return cast(@domain.autoIncrement as int) == cast(#{number} as int)
end
Expand Down Expand Up @@ -535,27 +535,27 @@ end
enum ["utf8", "utf8mb4"]
hint "允许使用的字符集"

// 对于 ALTER 语句,只有当设置了 character set 选项时候才进行校验
// For ALTER statements, validate only when the character set option is set
if
@domain.sqlType in ['ALTER_TABLE', 'ALTER_TABLE_CONVERT'] and
@func.string.isNotBlank(@domain.characterSet)
then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end

end

// 对于 create 语句,检测是否必须设置 character set 选项
// For create statements, check whether the character set option is required
if @domain.sqlType == 'CREATE_TABLE' then

if cast(#{require} as bool) then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end
Expand All @@ -582,27 +582,27 @@ end
enum ["utf8_unicode_ci", "utf8mb4_unicode_ci"]
hint "允许使用的排序规则"

// 对于 ALTER 语句,只有当设置了 collate 选项时候才进行校验
// For ALTER statements, validate only when the collate option is set
if
@domain.sqlType in ['ALTER_TABLE', 'ALTER_TABLE_CONVERT'] and
@func.string.isNotBlank(@domain.collate)
then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end

end

// 对于 create 语句,检测是否必须设置 collate 选项
// For create statements, check whether the collate option is required
if @domain.sqlType == 'CREATE_TABLE' then

if cast(#{require} as bool) then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end
Expand All @@ -629,27 +629,27 @@ end
enum ["InnoDB", "MyISAM", "Memory"]
hint "允许使用的存储引擎"

// 对于 ALTER 语句,只有当设置了 engine 选项时候才进行校验
// For ALTER statements, validate only when the engine option is set
if
@domain.sqlType in ['ALTER_TABLE', 'ALTER_TABLE_CONVERT'] and
@func.string.isNotBlank(@domain.engine)
then

if @func.string.isBlank(#{engine}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.engine, #{engine})
end

end

// 对于 create 语句,检测是否必须设置 engine 选项
// For create statements, check whether the engine option is required
if @domain.sqlType == 'CREATE_TABLE' then

if cast(#{require} as bool) then

if @func.string.isBlank(#{engine}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.engine, #{engine})
end
Expand Down Expand Up @@ -720,27 +720,27 @@ end
enum ["utf8", "utf8mb4"]
hint "允许使用的字符集"

// 对于 modify/change 语句,只有当设置了 character set 选项时候才进行校验
// For modify/change statements, validate only when the character set option is set
if
@domain.sqlType == 'ALTER_TABLE_ALTER_COLUMN' and
@func.string.isNotBlank(@domain.characterSet)
then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end

end

// 对于 add column or create table 语句,检测是否必须设置 character set 选项
// For add column or create table statements, check whether the character set option is required
if @domain.sqlType in ['CREATE_TABLE_ADD_COLUMN', 'ALTER_TABLE_ADD_COLUMN'] then

if cast(#{require} as bool) then

if @func.string.isBlank(#{character_set}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.characterSet, #{character_set})
end
Expand All @@ -767,27 +767,27 @@ end
enum ["utf8_unicode_ci", "utf8mb4_unicode_ci"]
hint "允许使用的排序规则"

// 对于 modify/change 语句,只有当设置了 collate 选项时候才进行校验
// For modify/change statements, validate only when the collate option is set
if
@domain.sqlType == 'ALTER_TABLE_ALTER_COLUMN' and
@func.string.isNotBlank(@domain.collate)
then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end

end

// 对于 add column or create table 语句,检测是否必须设置 collate 选项
// For add column or create table statements, check whether the collate option is required
if @domain.sqlType in ['CREATE_TABLE_ADD_COLUMN', 'ALTER_TABLE_ADD_COLUMN'] then

if cast(#{require} as bool) then

if @func.string.isBlank(#{collate}) then
return false //规则配置错误
return false //Invalid rule configuration
else
return @func.string.equalsIgnoreCase(@domain.collate, #{collate})
end
Expand Down Expand Up @@ -1062,7 +1062,7 @@ then
end

if @func.string.isBlank(@domain.length) then
return false // 语句中长度为空,例如 create table abc(name char);
return false // The statement has an empty length, for example create table abc(name char);
else
return cast(@domain.length as int) <= cast(#{length} as int)
end
Expand Down Expand Up @@ -1097,7 +1097,7 @@ then
end

if @func.string.isBlank(@domain.length) then
return false // 语句中长度为空,例如 create table abc(name varchar);
return false // The statement has an empty length, for example create table abc(name varchar);
else
return cast(@domain.length as int) <= cast(#{length} as int)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected RSocketRespDTO<?> forwardRequest(String apiMethodName, String consoleI
refreshJwtTokenIfNeed();

Map<String, String> headers = new HashMap<>();
headers.put("jwt_token", jwtToken);
headers.put("dm_jwt_token", jwtToken);
// headers.put(SessionManager.CSRF_TOKEN_NAME, jwtToken);

log.info("[FORWARD] Send http request to worker api " + apiMethodName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// Map<String, String> contents = new HashMap<>();
// String fullMsg;
// if (atAll) {
// fullMsg = "<at user_id=\"all\">所有人</at>" + signName + msg;
// fullMsg = "<at user_id=\"all\">All</at>" + signName + msg;
// } else {
// fullMsg = signName + msg;
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ public MsgSendResult sendMessage(String ownerUid, ImSenderConfig imConfig, MsgCo
}

private void sendRecord(String ownerUid, MsgContent message) {
// TODO 将消息记录到数据库
// TODO Record messages to database
}

private void sendDone(String ownerUid, MsgContent message, MsgSendResult result) {
// TODO 更新消息发送到状态
// TODO Update Message to Status
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public Object logout(@RequestParam(required = false) Map<String, String> params,
return this.redirectOrDone(request, response, "/");
}

response.addCookie(RdpWebUtils.newCookie("jwt_token", StringUtils.EMPTY, true, 0));
response.addCookie(RdpWebUtils.newCookie(JwtService.jwtTokenName, StringUtils.EMPTY, true, 0));
return this.redirectOrDone(request, response, "/");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public ResWebData<?> loginMfaValid(@Valid @RequestBody LoginMfaValidFO validFO,
public Object logout(HttpServletRequest request, HttpServletResponse response) throws IOException {
String uid = (String) request.getAttribute(RdpUserService.UID);
String puid = (String) request.getAttribute(RdpUserService.PUID);
response.addCookie(RdpWebUtils.newCookie("jwt_token", StringUtils.EMPTY, true, 0));
response.addCookie(RdpWebUtils.newCookie(JwtService.jwtTokenName, StringUtils.EMPTY, true, 0));
rdpOpAuditService.logAndAddOperationAudit(//
puid, uid, request.getRequestURI(), request.getRemoteAddr(), uid, "", SecurityLevel.NORMAL, AuditType.LOGOUT, ResourceType.ACCOUNT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

public interface JwtService {

String jwtTokenName = "jwt_token";
String opPwdToken = "op_pwd_token";
String jwtTokenName = "dm_jwt_token";
String opPwdToken = "dm_op_pwd_token";
String LOGIN_TYPE = "loginType";
int minLoginExpireSec = 1200;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
public class RdpClassUtil {

/**
* 扫描jar包中凡是匹配compareType参数的类均被返回。(对执行结果不缓存)
* @param matcherType 匹配的类型,可以是类标注的注解、实现的接口、继承的父类。
* @return 返回扫描结果。
* Returns all classes in the scanned jar package that match the compareType parameter. (Depends on implementation results.)
* @param matcherType Matching type, which can be the class description, implemented interfaces, or inherited parent class.
* @return Returns the results of the scan.
*/
public static Set<Class<?>> getClassSet(ClassLoader classLoader, CgResourceScanner scanner, String[] loadPackages, Class<?> matcherType) throws ClassNotFoundException {
Set<String> namesSet = scanner.getClassNamesSet(loadPackages, context -> {
Expand Down
Loading