Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -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 @@ -81,3 +81,4 @@
// private Object data;
// }
//}

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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
package com.clougence.rdp.controller;

import static com.clougence.clouddm.platform.dal.model.monitor.SecurityLevel.HIGH;
import static com.clougence.clouddm.sdk.security.auth.def.SecRoleAuthLabel.*;
import static com.clougence.clouddm.sdk.security.auth.def.SecRoleAuthLabel.RDP_USER_MANAGE;
import static com.clougence.clouddm.sdk.security.auth.def.SecRoleAuthLabel.RDP_USER_READ;

import java.util.List;

Expand All @@ -33,6 +34,7 @@
import com.clougence.clouddm.console.web.global.config.DmConsoleConfig;
import com.clougence.clouddm.console.web.global.i18n.DmI18nUtils;
import com.clougence.clouddm.console.web.global.i18n.I18nRdpMsgKeys;
import com.clougence.clouddm.console.web.global.jwtsession.JwtService;
import com.clougence.clouddm.console.web.global.jwtsession.RequestAuth;
import com.clougence.clouddm.console.web.model.fo.ResetPasswdFO;
import com.clougence.clouddm.console.web.model.fo.role.UpdateUserRoleFO;
Expand Down Expand Up @@ -235,7 +237,7 @@ public ResWebData<?> updateUserRole(@Valid @RequestBody UpdateUserRoleFO fo, Htt
.getSubAccountUid(), lo, SecurityLevel.HIGH, AuditType.UPDATE_SUB_ACCOUNT_ROLE, ResourceType.ACCOUNT);

if (StringUtils.equals(uid, fo.getSubAccountUid())) {
Cookie cookie = new Cookie("jwt_token", StringUtils.EMPTY);
Cookie cookie = new Cookie(JwtService.jwtTokenName, StringUtils.EMPTY);
cookie.setHttpOnly(true);
cookie.setMaxAge(0);
cookie.setPath("/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
// // refreshJwtTokenIfNeed();
// //
// // Map<String, String> headers = new HashMap<>();
// // headers.put("jwt_token", jwtToken);
// // headers.put("dm_jwt_token", jwtToken);
// // headers.put(RdpJwtManager.CSRF_TOKEN_NAME, jwtToken);
// // GrepOperationLogFO forwardDTO = new GrepOperationLogFO();
// // forwardDTO.setOperationId(operationId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ private static String fixedLenRandomStr(int length) {
for (int i = 0; i < length; i++) {
flag = (int) (Math.random() * 2);
if (flag == 0) {
// 产生数字
// Generate numbers
int charVal = (int) (Math.random() * 10 + 48);
fixedLenRandomCharArr[i] = (char) charVal;
} else {
// 产生小写字母
// Generate lowercase letters
int charVal = (int) ((Math.random() * 26) + 97);
fixedLenRandomCharArr[i] = (char) charVal;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.apache.ibatis.type.JdbcType;

/**
* 读写枚举类型,支持枚举实现 {@link EnumOfCode}{@link EnumOfValue} 接口。
* Reads and writes enum values, supporting enums that implement {@link EnumOfCode} or {@link EnumOfValue}.
* @author 赵永春 (zyc@hasor.net)
* @version : 2020-11-29
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.clougence.utils.ThreadUtils;

/**
* 业务线程
* Business thread
* @version : 2014年11月11日
* @author 赵永春 (zyc@hasor.net)
*/
Expand Down Expand Up @@ -65,7 +65,7 @@ public Executor getExecute(String serviceUniqueName) {
return this.defaultExecutor;
}

/** 停止应用服务 */
/** Stop application service */
public void shutdown() {
List<ThreadPoolExecutor> executorList = new ArrayList<>(this.servicePoolCache.values());
executorList.add(this.defaultExecutor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 +417,18 @@ public int available() {

@Override
public synchronized void mark(int readLimit) {
// TODO 实现 mark 方法,用于标记当前读取位置。
// TODO achieves the mark method for tagging the current reading position.
}

@Override
public synchronized void reset() throws IOException {
// TODO 实现 reset 方法,用于将读取位置重置到 mark 标记的位置。
// TODO achieves the reset method to reset the reading position to the mark.
throw new IOException("mark/reset not supported");
}

@Override
public boolean markSupported() {
// TODO 实现 markSupported 方法,返回是否支持 mark reset
// TODO achieves markSuppled approach, returns whether or not to support mark and reset.
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public ResultSetValue readAsString(ColMetaData meta, QueryResultConf conf, long
}

StringWriter w = new StringWriter();
char[] buffer = new char[1024]; // 缓冲区
char[] buffer = new char[1024]; // Buffer
long charsToRead = length;
while (charsToRead > 0) {
int len = (int) Math.min(buffer.length, charsToRead);
Expand All @@ -272,7 +272,7 @@ public ResultSetValue readAsString(ColMetaData meta, QueryResultConf conf, long
value = w.toString();

while (true) {
int read = r.read(buffer); // 复用缓冲区
int read = r.read(buffer); // Reuse the buffer
if (read == -1) {
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.clougence.clouddm.dsfamily.mysql.dialect.MySqlDialect;

/**
* MySQL 的 SqlDialect 实现
* MySQL SQLDialect implementation.
* @version : 2020-10-31
* @author 赵永春 (zyc@hasor.net)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.clougence.utils.StringUtils;

/**
* ClickHouse 的 SqlDialect 实现
* SQLDialec of Clickhouse
* @version : 2020-10-31
* @author 赵永春 (zyc@hasor.net)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.clougence.utils.StringUtils;

/**
* 达梦 的 SqlDialect 实现
* SQLDialect
* @version : 2020-10-31
* @author 赵永春 (zyc@hasor.net)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* 达梦 元信息获取,参考资料:
* Dameng metadata retrieval references:
* <li>https://docs.oracle.com/en/database/oracle/oracle-database/21/drdag/all_synonyms-drda-gateway.html#GUID-E814A6AC-5E00-4DB6-8170-DC147F7879F8</li>
*
* @author 赵永春 (zyc@hasor.net)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* 达梦 元信息获取,参考资料:
* Dameng metadata retrieval references:
* <li>https://docs.oracle.com/en/database/oracle/oracle-database/21/drdag/all_synonyms-drda-gateway.html#GUID-E814A6AC-5E00-4DB6-8170-DC147F7879F8</li>
*
* @author 赵永春 (zyc@hasor.net)
Expand Down Expand Up @@ -334,7 +334,7 @@ public static List<RdbColumn> convertColumn(ResultSet rs) throws SQLException {
column.setAttribute(RdbAttributeNames.JDBC_TYPE, columnTypeMappingToJdbcType(column.getSqlType(), dataType));

if (dataType == null && StringUtils.isNotBlank(typeOwner)) {
column.setAttribute(COLUMN_TYPE, JDBCType.STRUCT.getName()); // Type Name 表示一定是用户创建的类型。
column.setAttribute(COLUMN_TYPE, JDBCType.STRUCT.getName()); // Type Name indicates a user-created type.
}

DmSqlTypes sqlType = (DmSqlTypes) column.getSqlType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.clougence.clouddm.dsfamily.mysql.dialect.MySqlDialect;

/**
* MySQL 的 SqlDialect 实现
* MySQL SQLDialect implementation.
* @version : 2020-10-31
* @author 赵永春 (zyc@hasor.net)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* Postgres 元信息获取,参考资料:
* Postgres meta-information acquisition, reference:
* <li>https://www.postgresql.org/docs/13/information-schema.html</li>
*
* @version : 2021-04-29
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* Postgres 元信息获取,参考资料:
* Postgres meta-information acquisition, reference:
* <li>https://www.postgresql.org/docs/13/information-schema.html</li>
*
* @version : 2021-04-29
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* Postgres 元信息获取,参考资料:
* Postgres meta-information acquisition, reference:
* <li>https://www.postgresql.org/docs/13/information-schema.html</li>
*
* @version : 2021-04-29
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.clougence.utils.StringUtils;

/**
* Hana 的 SqlDialect 实现
* Hana SQLDialect implementation.
* @version : 2020-10-31
* @author hanlizhi
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.clougence.utils.StringUtils;

/**
* ODPS 的 SqlDialect 实现
* SQLDialec of ODS
* @version : 2020-10-31
* @author 赵永春 (zyc@hasor.net)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* Postgres 元信息获取,参考资料:
* Postgres meta-information acquisition, reference:
* <li>https://www.postgresql.org/docs/13/information-schema.html</li>
* @version : 2021-04-29
* @author 赵永春 (zyc@hasor.net)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* Postgres 元信息获取,参考资料:
* Postgres meta-information acquisition, reference:
* <li>https://www.postgresql.org/docs/13/information-schema.html</li>
* @version : 2021-04-29
* @author 赵永春 (zyc@hasor.net)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* MySQL 元信息获取,参考资料:
* MySQL metadata acquisition, reference:
* <li>https://dev.mysql.com/doc/refman/8.0/en/information-schema.html</li>
*
* @author 赵永春 (zyc@hasor.net)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* MySQL 元信息获取,参考资料:
* MySQL metadata acquisition, reference:
* <li>https://dev.mysql.com/doc/refman/8.0/en/information-schema.html</li>
*
* @author 赵永春 (zyc@hasor.net)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class McDetermineExceptionSpi extends AbstractDetermineExceptionSpi {

static {
MC_CONNECT_ERROR_MESSAGES = new ArrayList<>(BASIC_CONNECT_ERROR_MESSAGES);
//MC_CONNECT_ERROR_MESSAGES.add("网络通信异常");
//MC_CONNECT_ERROR_MESSAGES.add("Network communication exception");

MC_AUTH_ERROR_MESSAGES = new ArrayList<>(BASIC_AUTH_ERROR_MESSAGES);
//MC_AUTH_ERROR_MESSAGES.add("用户名或密码错误");
//MC_AUTH_ERROR_MESSAGES.add("Incorrect username or password");
//MC_AUTH_ERROR_MESSAGES.add("Invalid username or password");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.clougence.utils.StringUtils;

/**
* ODPS 的 SqlDialect 实现
* SQLDialec of ODS
* @version : 2020-10-31
* @author 赵永春 (zyc@hasor.net)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lexer grammar MongoLexer;
channels { COMMENT }

/* skip spaces */
SPACE : [ \t\f\r\n]+ -> channel(HIDDEN); // skip spaces, (空格\水平制表符\换行\回车\换页)
SPACE : [ \t\f\r\n]+ -> channel(HIDDEN); // Skip spaces: space, horizontal tab, line break, carriage return, and form feed.
COMMENT1: '//' (~[\n\r])* -> channel(COMMENT);
COMMENT2: '/*' .*? '*/' -> channel(COMMENT);
//EOL : ('\r''\n'? | '\n');
Expand Down Expand Up @@ -232,4 +232,3 @@ fragment EXP
// exponent number permits leading 0s (e.g. `1e01`)
: [Ee] [+-]? [0-9]+
;

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parser grammar MongoParser;
options { tokenVocab = MongoLexer; }
/* ----------------------------------------------------------------------------------- basic type */

/* 入口 */
/* Entry point */
root : command (SEMI+ command)* SEMI* EOF;

command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public MongoSelectColumnAnalysisSpi(MetaService metaService){

@Override
public List<SelectItem> parseSelectColumn(String script, ContextInfo info) {
return Collections.emptyList(); // TODO 需要根据具体的Redis命令,返回对应的列信息
return Collections.emptyList(); // TODO return column information for the specific MongoDB command.
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* Redis 元信息获取,参考资料:
* Redis metadata access, reference:
*
* @version : 2021-04-29
* @author 赵永春 (zyc@hasor.net)
Expand Down
Loading