To bind is to authenticate as a user against the user, where the user is specified by a DN (Distinguished Name). This operation can prompt inputting one time passwords on a mobile device etc, so its relevant to not do twice in a row.
When we create the connection object, we automatically bind as part of doing so in all cases. Due to that, its not relevant to first acquire the connection and then do conn.bind().
In this PR you'll see how I move logic to get_connection and letting it handle raised errors failing on failing to bind by emitting a warning and returning None. Using get_connection can then be reduced to calling it and checking the return value. Any connectivity or encryption issues will still be raised and not handled by get_connection.
To bind is to authenticate as a user against the user, where the user is specified by a DN (Distinguished Name). This operation can prompt inputting one time passwords on a mobile device etc, so its relevant to not do twice in a row.
When we create the connection object, we automatically bind as part of doing so in all cases. Due to that, its not relevant to first acquire the connection and then do
conn.bind()
.In this PR you'll see how I move logic to
get_connection
and letting it handle raised errors failing on failing to bind by emitting a warning and returning None. Usingget_connection
can then be reduced to calling it and checking the return value. Any connectivity or encryption issues will still be raised and not handled by get_connection.