-
Notifications
You must be signed in to change notification settings - Fork 178
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 for multiple bind templates #23
Conversation
1. modified bind_Dn_template from Unicode to List 2. Added the logic to handle multiple DNs
Thank you very much for the patch! Apologies for the late review, I've been on vacation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, style and backwards compat issues :) Thanks a lot for the patch! <3
@@ -28,7 +28,7 @@ def _server_port_default(self): | |||
help='Use SSL to encrypt connection to LDAP server' | |||
) | |||
|
|||
bind_dn_template = Unicode( | |||
bind_dn_template = List( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should allow this to continue to be a Unicode, to prevent backwards compatibility issues. This could be done with a Union traitlet type I think.
conn = ldap3.Connection(server, user=userdn, password=password) | ||
self.log.debug("GOT LDAP CONNECTION FOR USER: '%s'", conn) | ||
isBound = conn.bind() | ||
self.log.debug("CONN_BIND: "+ str(isBound) + ":" + username ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all logging, you can use format strings instead of explicit concatenation.
self.log.debug('Attempting to bind with dn %s', dn)
|
||
isBound = False | ||
for dn in self.bind_dn_template: | ||
#self.log.debug("LOOPING DN") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the commented out line?
for dn in self.bind_dn_template: | ||
#self.log.debug("LOOPING DN") | ||
userdn = dn.format(username=username) | ||
self.log.debug("DN: '%s'", userdn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These four logging statements can probably be collapsed into two:
- Specify the username being checked and the userdn being used
- Specify status of bind
Hey @kishorchintal. Are you still interested in taking this patch through, or would you like me to work through making these changes myself? |
I'll probably pick this up in a week or so if there's no response :) |
Hi Yuvi,
Apologies for delayed response. I've been away from work for past couple of
weeks. I'll try to get this patch to you next week.
Kishor
…On Sun, Nov 27, 2016 at 5:06 PM Yuvi Panda ***@***.***> wrote:
I'll probably pick this up in a week or so if there's no response :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APTv_2GSxGlgGaTqlrZOtcaMQow4xSZSks5rCikfgaJpZM4KJXXR>
.
|
Thanks! Looking forward to it :)
On Tue, Nov 29, 2016 at 8:56 AM, kishorchintal <notifications@github.com>
wrote:
… Hi Yuvi,
Apologies for delayed response. I've been away from work for past couple of
weeks. I'll try to get this patch to you next week.
Kishor
On Sun, Nov 27, 2016 at 5:06 PM Yuvi Panda ***@***.***>
wrote:
> I'll probably pick this up in a week or so if there's no response :)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/jupyterhub/ldapauthenticator/
pull/23#issuecomment-263162152>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/APTv_
2GSxGlgGaTqlrZOtcaMQow4xSZSks5rCikfgaJpZM4KJXXR>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB23ixfKgkOnmZAjQqHc7_UL1Af3FP0ks5rC3hEgaJpZM4KJXXR>
.
--
Yuvi Panda T
http://yuvi.in/blog
|
@yuvipanda - I've made the changes suggested, pls review. |
modularized the code
Looks like review has been addressed. Thanks, @kishorchintal! |
No description provided.