ruby-ldap / ruby-net-ldap

Pure Ruby LDAP library
https://rubygems.org/gems/net-ldap
Other
400 stars 254 forks source link

Support specifying LDAP servers with URIs #246

Open danleyden opened 8 years ago

danleyden commented 8 years ago

Currently LDAP connections are set up by passing in, among other things, the host, port, auth credentials and if TLS should be used all as separate items.

This could be simplified to be passed in as a URI (or collection of URIs when multiple servers are needed).

Ruby's built in URI library supports parsing of LDAP and LDAPS URIs, and could be used to reduce the number of arguments being passed in to just one - a string that contains much of the information already.

Many other systems allow sysadmins etc. to configure LDAP endpoints using a series of URIs in config files. Providing support for URIs in this would allow applications using this library to simply pass those through instead of having to translate them.

jch commented 8 years ago

@danleyden that's a great idea. Would you be interested in submitting a pull request for this? I'd be happy to review.