Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 0.9.1 #284

Merged
merged 59 commits into from Mar 24, 2021
Merged

Dev 0.9.1 #284

merged 59 commits into from Mar 24, 2021

Conversation

det101
Copy link
Contributor

@det101 det101 commented Feb 24, 2021

Version 0.9.1 code, to achieve user to create modules

@Adamyuanyuan
Copy link
Collaborator

thanks

Copy link
Collaborator

@Adamyuanyuan Adamyuanyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Copy link
Collaborator

@Adamyuanyuan Adamyuanyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pay attention to security compliance, hide IP, password, etc

@@ -17,11 +17,11 @@

wds.linkis.test.mode=true

wds.linkis.server.mybatis.datasource.url=jdbc:mysql://127.0.0.1:3306/
wds.linkis.server.mybatis.datasource.url=jdbc:mysql://192.168.10.180:3306/dss
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide IP, password, etc

Copy link

@xj2jx xj2jx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your cubmits.
Some suggestions for modification are pended. The biggest problem is the design of Command and AbsComand. I feel that the interface in Command is not universal.

Comment on lines 28 to 35
//增加是否超级用户表示 0-不是超级用户 1-是超级用户
private int isSuperUser = 0;

public int getIsSuperUser() {
return isSuperUser;
}
public void setIsSuperUser(int isSuperUser) {
this.isSuperUser = isSuperUser;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the code style, isSupperUser should use Boolean

Comment on lines +77 to +82
public static void main(String[] args) throws Exception {
// System.out.println(redirectUrlFormat("http://127.0..0.1:8090/qualitis/api/v1/redirect","http://127.0..0.1:8090/#/projects/list?id={projectId}&flow=true"));

WorkSpacePath workSpacePath = new WorkSpacePath();
workSpacePath.setWorkspaceRootPath("/");
System.out.println(convertToMap(workSpacePath));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remove test code

@@ -25,6 +25,15 @@
private String username;
private String name;
private Boolean isFirstLogin;
//增加是否超级用户表示 0-不是超级用户 1-是超级用户
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment need use English

Comment on lines 78 to 82
//是否超级用户登录
if(username.equals(superUserName)){
dssUser.setIsSuperUser(1);
}else{
dssUser.setIsSuperUser(0);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using magic values, use Boolean can avoid it

Comment on lines 64 to 70
LOGGER.info("开始读取用户token文件");
Properties properties = new Properties();
try {
properties.load(AzkabanSecurityService.class.getClassLoader().getResourceAsStream(AzkabanConstant.TOKEN_FILE_NAME));
userToken = properties;
} catch (IOException e) {
LOGGER.error("读取文件失败:",e);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't print the Chinese log only, but can only print the English log.

String path = DSSUserManagerConfig.METASTORE_HDFS_PATH + "/"+dbName+".db";
bashCommand = getResource(DSSUserManagerConfig.METASTORE_SCRIPT_PAHT);
args = new String[]{ userName,dbName,path,
DSSUserManagerConfig.KERBEROS_REALM,DSSUserManagerConfig.KERBEROS_ADMIN,DSSUserManagerConfig.KERBEROS_KEYTAB_PATH,DSSUserManagerConfig.KEBBEROS_ENABLE_SWITCH};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if cluster not open kerberos, maybe this code cann't running, please check it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have used parameters: DSSUserManagerConfig.KERBEROS_ ENABLE_ Switch controls it

RestTemplate restTemplate = new RestTemplate();
String schedulisUrl = DSSUserManagerConfig.SCHEDULER_ADDRESS;
String url = new StringBuilder().append(schedulisUrl)
.append("/luban/schedule/system")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this url suggest to modify, make the url configurable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. It has been revised

@@ -0,0 +1,39 @@
package com.webank.wedatasphpere.dss.user.conf;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all user-manager model file need to add License.

/*

  • Copyright 2019 WeBank
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at
  • http://www.apache.org/licenses/LICENSE-2.0
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

*/

@Override
public String authorization(AuthorizationBody body) throws IOException,DocumentException, Exception { return Command.SUCCESS; }
public String toMessage(String msg) {
return this.getClass().getSimpleName() + "模块开始执行:"+ msg;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please replace Chinese by English

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. It has been revised

@@ -28,4 +28,6 @@
public static final String EMVEDDEDFLOWID = "\"embeddedFlowId\":";
public static final String VERSION_FORMAT = "%06d";
public static final String VERSION_PREFIX = "v";
public static final String SUPER_USER_LOGIN_ERROR = "没有创建权限,请使用超级用户登录";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please replace Chinese by English

@wushengyeyouya wushengyeyouya requested a review from demonray March 18, 2021 07:45
Copy link
Contributor

@demonray demonray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@wushengyeyouya wushengyeyouya merged commit cd4e7c9 into WeBankFinTech:dev-0.9.1 Mar 24, 2021
htyredc pushed a commit that referenced this pull request Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants