jupyterhub / ldapauthenticator

LDAP Authenticator Plugin for Jupyter
BSD 3-Clause "New" or "Revised" License
202 stars 175 forks source link

Allow secondary LDAP servers #190

Open bloodeagle40234 opened 3 years ago

bloodeagle40234 commented 3 years ago

Currently, ldapauthenticator supports only one LDAP server url. That means, when the server failed down, jupyterhub cannot authenticate any incoming requests.

This pull request adds the new configurations "secondary_uri" and "connect_timeout" to support secondary LDAP servers. secondary_uri takes comma separated "server:port" style string that can be candidates when the primary server configured by legacy "server_address" and "server_port" options. "connect_timeout" is the timeout that ldapauthenticator can give up the attempt connection, and then redirect to the secondaries.

This change doesn't break any backward compatibilities on server_address/server_port configuration. When operators want to use secondaries, just adding the new secondary_uri options is enough.

This is another approach from https://github.com/jupyterhub/ldapauthenticator/pull/184

welcome[bot] commented 3 years ago

Thanks for submitting your first pull request! You are awesome! :hugs:
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! :wave:
Welcome to the Jupyter community! :tada:

bloodeagle40234 commented 3 years ago

OK. I'll try to fix those gate failures.

bloodeagle40234 commented 3 years ago

Hmm... I may be missing something on Github actions testing configuration. In my local ubuntu, I can pass the tests with ci/docker-ldap.sh example LDAP server but it seems to get failed within CI. Even the existing tests, they got something troubled with it.

bloodeagle40234 commented 3 years ago

Ah.. I may get my mistake into this patch. Let me fix those...

bloodeagle40234 commented 3 years ago

Thanks @manics for merging jupyterhub/ldapauthenticator/pull/192 . I rebased and cleanup this patch to address to current master. Could you have time to review this too?