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

Allow multiple LDAP servers #184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

statiksof
Copy link

@statiksof statiksof commented Nov 12, 2020

Today, we had one of our LDAP servers down, so I searched if it is possible to specify multiple servers as a list. I found this #170, which is still open. The following changes worked for me. Any thoughts?

These changes are based on https://ldap3.readthedocs.io/en/latest/server.html#server-pool.

@welcome
Copy link

welcome bot commented Nov 12, 2020

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR. I think a bit more discussion is needed on how to support the use-cases in #170 e.g at the moment ports aren't handled.

@bloodeagle40234 as the author of #170 do you have any comments on this PR?

@@ -12,7 +12,7 @@


class LDAPAuthenticator(Authenticator):
server_address = Unicode(
server_address = List(
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change, if you use traitlets.Union you should be able to maintain backwards compatibility.

server_pool = ldap3.ServerPool(self.server_address,
ldap3.ROUND_ROBIN,
active=True,
exhaust=True)
Copy link
Member

Choose a reason for hiding this comment

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

With this change self.server_port is ignored

@bloodeagle40234
Copy link

I already tested a couple of versions; use of ServerPool or not use; then adapted latter one on my private production environment because the server pool would not be flexible on the aspect of backward compatibility and timeout between the server switching.

@manics could you suggest where contributers docs located? (mainly CLA article is minded on my company) I'll be able to prepare to push my patch with backward compatibility including unittests if you all could wait on me.

@bloodeagle40234
Copy link

I pushed my patch to my repository's branch and the diff from master is at master...bloodeagle40234:server-redirects

Could you let me hear your opinion if either is fine to the upstream?

My patch doesn't intend to use the ldap servers as roundrobin but has backward compatibility in the configuration and no wait penalty when switching the LDAP servers.

If you prefer my version, I'll push it as a new Pull Request to the upstream repository.

Thanks.

@lahwaacz
Copy link

What's the progress? Can we finish this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants