Skip to content

KYLIN-5270: Contribute eBay's part authentication mechanism to kylin5#1986

Open
Syleechan wants to merge 4 commits intoapache:kylin5from
Syleechan:kylin5
Open

KYLIN-5270: Contribute eBay's part authentication mechanism to kylin5#1986
Syleechan wants to merge 4 commits intoapache:kylin5from
Syleechan:kylin5

Conversation

@Syleechan
Copy link
Copy Markdown
Contributor

Proposed changes

Contribute eBay's part authentication mechanism to kylin5

Branch to commit

  • Branch kylin3 for v2.x to v3.x
  • Branch kylin4 for v4.x
  • Branch kylin5 for v5.x

Types of changes

What types of changes does your code introduce to Kylin?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have created an issue on Kylin's jira, and have described the bug/feature there in detail
  • Commit messages in my PR start with the related jira ID, like "KYLIN-0000 Make Kylin project open-source"
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged

Further comments

If this is a relatively large or complex change, kick off the discussion at user@kylin.apache.org or dev@kylin.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

}

@Override
public boolean userExists(String userName){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

username maybe better.

Comment on lines +69 to +79
if(!ifRegistered){
try{
accessProvider.checkAccessible(userName);// default true
} catch (AccessDeniedException e){
logger.info("user {} is not able to access Kylin due to ", userName, e);
return false;
}
ManagedUser newUser = new ManagedUser(userName);
userService.createUser(newUser);
}
return true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this logic looks a little weird.
if accessProvider.checkAccessible(userName) is false, it will create a new user. And if it is true, it will create a new user too by code reading directly.
And this method does two things, check user exists and create a new user.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this logic first check if the user in system just use KylinUserService to check, if false then use accessProvider.checkAccessible(userName) to check, if false it will return fasle then method loadUserByUserName in class SelfManagedAuthoritiesPopulator would throw exception; if accessProvider.checkAccessible(userName) is true means user can access system and create user info.

}

@Override
public void deleteUser(String userName) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

username may be better.

@hit-lacus
Copy link
Copy Markdown
Member

Can one of the admins verify this patch?

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.

3 participants