Question

Is there a Rails plugin or a rubygem that gives you a starting point for adding an api to your Rails app? We want to use the API Key/Secret Key model, the API should also be versionable. Is there something out there that will give us some, if not all of this?

Was it helpful?

Solution

Check out this plugin for AuthLogic:

http://github.com/phurni/authlogic_api

I think that does what you are looking for.

OTHER TIPS

The OAuth plugin could be useful for the keys. It may look like OAuth is only for user authentication, but if you autogenerate the access tokens and give them to developers, instead of having an interactive user process with request tokens and account authorization, then you basically have a quite secure API key system. And the plugin will just drop in nicely.

Other than that, some nice use of rails' routes (with conditions to call a different action on get, post, put, etc, and a prefix of /api/v1/) and format (format.xml, format.js, etc) provides a pretty nice way to build RESTful APIs, withought really needing a plugin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top