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

Support multiple LDAP user bind patterns #5874

Merged
merged 5 commits into from
Nov 22, 2020
Merged

Conversation

dain
Copy link
Member

@dain dain commented Nov 9, 2020

No description provided.

Copy link
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

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

Just skimmed.

String groupSearch = replaceUser(groupAuthorizationSearchPattern.get(), user);
if (!isGroupMember(searchBase, groupSearch, userDistinguishedName, credential.getPassword())) {
String message = format("User [%s] not a member of an authorized group", user);
log.debug(message);
Copy link
Member

Choose a reason for hiding this comment

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

There is no point in logging when you throw

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, but all of the code in this class logs and throws, so I copied the style of the existing code.

Copy link
Member

Choose a reason for hiding this comment

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

The authentication code is kind of an exception, since the access denied causes an auth failure without any stack trace or logging. We might want to move the logging to the authentication system itself, but that's a separate project from this refactoring.

Copy link
Member Author

Choose a reason for hiding this comment

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

Talked to @electrum, we're going to leave this as is for now

@dain
Copy link
Member Author

dain commented Nov 18, 2020

@kokosing I added another commit with some abstractions to simplify this code, but I didn't change the logging as that is what the existing code did.

@dain dain merged commit 05409df into trinodb:master Nov 22, 2020
@dain dain deleted the multiple-ldap branch November 22, 2020 01:08
@dain dain mentioned this pull request Nov 22, 2020
10 tasks
@martint martint added this to the 347 milestone Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants