Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails app as an LDAP or CardDAV server?

I'm working on an in-house Rails app, which is (among other things) a CRM app so it contains names, addresses etc., for customers and other contacts.
A neat feature would to allow these contacts to be fetched/searched over by clients such as email programs and address book apps (i.e. just simple read-only access).

The idea would be to use LDAP or CardDAV for this, but I haven't been able to much (recent) info on how to achieve it.

For CardDAV, I've found basically nothing.

For LDAP, I've found plenty of LDAP client gems and plugins, but only a few LDAP server implementations. What I've found so far is the plain Ruby LDAP server and LDAP-ActiveRecord-gateway, which is built on top of the former.

The latter sounds like it'd fit the ticket, but it explicitly says "Deprecated without replacement" (in June of this year). It might still work, but I can't say I'm too keen on using it, now that it's been abandoned.

So I was wondering if there's anything more recent out there? Is there some automagical gem or plugin I can use? Or some clues, hints, or tutorials I can dig into? While I'm not above writing everything myself, I'd rather avoid that.

like image 310
Flambino Avatar asked Dec 27 '11 23:12

Flambino


2 Answers

Instead of looking for a Ruby LDAP Server implementation, it will probably be easier for you to run a real LDAP server if you can, and just update its directory from your Rails App when the data changes. This has several benefits:

  • You can use an LDAP server that has regular security updates.
  • You can use Ruby's excellent and built-in file operations to update the LDAP server's data by writing LDIF ("LDAP Data Interchange Format") files and then sending those to the server.

Some Resources:

  • http://www.fefe.de/tinyldap/ - A small and fast LDAP implementation
  • http://www.sudleyplace.com/LDAP/index.en.html - How to set up an LDAP Server
  • http://www.openldap.org/faq/data/cache/267.html - List of LDAP server software
like image 103
Moshe Katz Avatar answered Nov 08 '22 09:11

Moshe Katz


I was doing some some research on the same thing and found this! It's a CardDAV server based in Rails. I know it's not packed up into a gem... but perhaps you can bend it to your will? https://github.com/inferiorhumanorgans/meishi

Also, since it's been a while, how did your LDAP implementation turn out?

like image 31
counterbeing Avatar answered Nov 08 '22 10:11

counterbeing