Rails app as an LDAP or CardDAV server?
Asked Answered
T

2

8

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.

Theresita answered 27/12, 2011 at 23:40 Comment(0)
R
5

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:

Reviel answered 30/12, 2011 at 4:47 Comment(2)
Good point, and thanks for the links! I thought about that myself after writing the question, but I couldn't help but feel like it'd be overkill to setup a wholly separate LDAP server, and keep it in sync, considering I just want to serve some very simple contact info. Frankly, I'd rather use CardDAV since it's HTTP, but as mentioned, I haven't found anything to go on there. I'll leave the question open for a while longer, but your answer is definitely a valid one.Theresita
Well, it appears that no one wants to challenge your suggested solution, and as I said, it's definitely a valid one. And I haven't been able to find anything either, so here's a checkmark for you :)Theresita
T
2

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?

Tramp answered 24/8, 2012 at 0:34 Comment(1)
Never did get around to implement anything. When I asked, I was mostly researching options. Since then, well, things change (read: new job). Still, thanks for the tip - much appreciated. I imagine I might have need of it some day for another project.Theresita

© 2022 - 2024 — McMap. All rights reserved.