Skip to content

KYLIN-4122 Add kylin user and group manage modules#790

Merged
nichunen merged 1 commit intoapache:masterfrom
luguosheng1314:master
Aug 15, 2019
Merged

KYLIN-4122 Add kylin user and group manage modules#790
nichunen merged 1 commit intoapache:masterfrom
luguosheng1314:master

Conversation

@luguosheng1314
Copy link

No description provided.

@asfgit
Copy link

asfgit commented Aug 7, 2019

Can one of the admins verify this patch?

@codecov-io
Copy link

codecov-io commented Aug 7, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@abc0ab8). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #790   +/-   ##
=========================================
  Coverage          ?   25.63%           
  Complexity        ?     6049           
=========================================
  Files             ?     1398           
  Lines             ?    83418           
  Branches          ?    11683           
=========================================
  Hits              ?    21386           
  Misses            ?    59975           
  Partials          ?     2057
Impacted Files Coverage Δ Complexity Δ
...c/main/java/org/apache/kylin/rest/DebugTomcat.java 0% <ø> (ø) 0 <0> (?)
.../org/apache/kylin/rest/util/AclPermissionUtil.java 0% <ø> (ø) 0 <0> (?)
...rg/apache/kylin/rest/service/UserGroupService.java 0% <0%> (ø) 0 <0> (?)
.../java/org/apache/kylin/metadata/acl/UserGroup.java 0% <0%> (ø) 0 <0> (?)
...in/java/org/apache/kylin/rest/util/PagingUtil.java 0% <0%> (ø) 0 <0> (?)
...apache/kylin/rest/request/PasswdChangeRequest.java 0% <0%> (ø) 0 <0> (?)
...ache/kylin/rest/service/KylinUserGroupService.java 0% <0%> (ø) 0 <0> (?)
...g/apache/kylin/rest/controller/UserController.java 0% <0%> (ø) 0 <0> (?)
...rg/apache/kylin/rest/service/KylinUserService.java 0% <0%> (ø) 0 <0> (?)
...va/org/apache/kylin/rest/security/ManagedUser.java 0% <0%> (ø) 0 <0> (?)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abc0ab8...f1103e8. Read the comment docs.

@coveralls
Copy link

coveralls commented Aug 8, 2019

Pull Request Test Coverage Report for Build 4842

  • 0 of 334 (0.0%) changed or added relevant lines in 10 files are covered.
  • 9 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.1%) to 28.122%

Changes Missing Coverage Covered Lines Changed/Added Lines %
server-base/src/main/java/org/apache/kylin/rest/service/UserGroupService.java 0 6 0.0%
server-base/src/main/java/org/apache/kylin/rest/util/AclPermissionUtil.java 0 9 0.0%
server-base/src/main/java/org/apache/kylin/rest/util/PagingUtil.java 0 11 0.0%
core-metadata/src/main/java/org/apache/kylin/metadata/acl/UserGroup.java 0 12 0.0%
server-base/src/main/java/org/apache/kylin/rest/request/PasswdChangeRequest.java 0 16 0.0%
server-base/src/main/java/org/apache/kylin/rest/security/ManagedUser.java 0 16 0.0%
server-base/src/main/java/org/apache/kylin/rest/service/KylinUserService.java 0 16 0.0%
server-base/src/main/java/org/apache/kylin/rest/controller/KylinUserGroupController.java 0 38 0.0%
server-base/src/main/java/org/apache/kylin/rest/service/KylinUserGroupService.java 0 82 0.0%
server-base/src/main/java/org/apache/kylin/rest/controller/UserController.java 0 128 0.0%
Files with Coverage Reduction New Missed Lines %
server/src/main/java/org/apache/kylin/rest/DebugTomcat.java 1 0.0%
server-base/src/main/java/org/apache/kylin/rest/controller/KylinUserGroupController.java 1 0.0%
core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java 2 68.46%
server-base/src/main/java/org/apache/kylin/rest/service/KylinUserGroupService.java 2 0.0%
core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/MemDiskStore.java 3 78.42%
Totals Coverage Status
Change from base Build 4840: -0.1%
Covered Lines: 23439
Relevant Lines: 83349

💛 - Coveralls

@nichunen nichunen self-requested a review August 12, 2019 12:36
@Qualifier("userGroupService")
private UserGroupService userGroupService;

private Pattern passwordPattern;

Choose a reason for hiding this comment

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

Inappropriate order for these variables

@RequestMapping(value = "/{userName:.+}", method = { RequestMethod.POST }, produces = { "application/json" })
@ResponseBody
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN)
//do not use aclEvaluate, if thgetManagedUsersByFuzzMatchingere's no users and will come into init() and will call save.

Choose a reason for hiding this comment

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

thgetManagedUsersByFuzzMatchingere?

List<ManagedUser> all = userService.listUsers();
logger.info("All {} users", all.size());
if (all.isEmpty() && ("testing".equals(System.getProperty(ACTIVE_PROFILES_NAME))
|| "custom".equals(System.getProperty(ACTIVE_PROFILES_NAME)))) {

Choose a reason for hiding this comment

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

what is "custom" for?


}

public UserDetails loadUserByUsername(String username) {

Choose a reason for hiding this comment

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

useless


import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

Choose a reason for hiding this comment

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

Seems not formatted correctly.

@JsonProperty
private long firstLoginFailedTime = 0L;

private static final int CHECK_TIME = 900000; //15 minutes

Choose a reason for hiding this comment

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

Seems useless

package org.apache.kylin.rest.service;

import java.io.IOException;
import java.util.ArrayList;

Choose a reason for hiding this comment

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

seems not formatted correctly

List<ManagedUser> userList = getKylinUserManager().list();
return getManagedUsersByFuzzMatching(userName, isFuzzMatch, userList, null);
}
@Override

Choose a reason for hiding this comment

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

Blank line should be inserted between methods

}
return groups;
}
public static boolean isAdmin() {

Choose a reason for hiding this comment

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

looks duplicate with BasicController.isAdmin

Copy link

@nichunen nichunen left a comment

Choose a reason for hiding this comment

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

LGTM

@nichunen nichunen merged commit 4651737 into apache:master Aug 15, 2019
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.

5 participants