Net::LDAP#encryption accepts string#239
Conversation
1a1f700 to
6a2f702
Compare
|
@satoryu thanks for starting this. I think your code is correct, but I'd rather we address underlying problem: we should have only one way of specifying encryption settings. I always thought it strange to have a method instead of a setter / constructor argument for setting encryption args. This is where I'd like to get to: class Net::LDAP
# encryption: Hash
# method: - :simple_tls (let's standardize on one key, not multiple aliases)
# options: - Hash of options for that method
def initialize(args)
@encryption = args[:encryption]
end
endI imagine we'd need to:
What do you think? |
|
imho the only weird part about this method is that it doesn't use the assigning signature def encryption=(args)
...
endwas the first method i was looking for. but other than that it is a nice way to set the setting. and it matches the function <=> option mapping you see with the other params for the initializer. |
|
@darix following the setter convention would be less surprising, but the problem is setting Thanks for that initial bug report to spark this discussion 👍 |
|
On 2015-11-30 09:56:06 -0800, Jerry Cheung wrote:
I do not see how that is much different from calling ldap_object.encryption(somearg)once the connection is established. We would have 2 options in that case. a) reject the setting with an error Net::LDAP::OpenConnectionError the second option might have unwanted consequences like incomplete |
|
@jch I agree with your idea about deprecating @darix I prefer option a) and showing deprecation massage when calling |
|
@satoryu any interest in PR-ing the ideas listed above? If you're busy, I'll try to carve out some time during the holidays. |
|
@jch sorry for late response. I'd like to keep doing PRing in this week end. |
Net::LDAP#encryption accepts string
|
@satoryu happy new years, and thanks for following up! |
=== Net::LDAP 0.13.0
* Set a connect_timeout for the creation of a socket
{#243}[ruby-ldap/ruby-net-ldap#243]
* Update bundler before installing gems with bundler
{#245}[ruby-ldap/ruby-net-ldap#245]
* Net::LDAP#encryption accepts string
{#239}[ruby-ldap/ruby-net-ldap#239]
* Adds correct UTF-8 encoding to Net::BER::BerIdentifiedString
{#242}[ruby-ldap/ruby-net-ldap#242]
* Remove 2.3.0-preview since ruby-head already is included
{#241}[ruby-ldap/ruby-net-ldap#241]
* Drop support for ruby 1.9.3
{#240}[ruby-ldap/ruby-net-ldap#240]
* Fixed capitalization of StartTLSError
{#234}[ruby-ldap/ruby-net-ldap#234]
As #238 reported, if
Net::LDAP.newis given encryption type asStringinstead ofSymbol, it breaks in establishing a connection.This pull request provides a solution: allowing to give encryption type as
String.CC: @darix