github/gollum — pull request #390 by arr2036 (2012-06-19 11:56:06+00:00)
Title: App rest fix

I submitted this a while back but it wasn't merged, because it started failing automerge, and no one could see the point.

Sinatra allows pre-emption of routes. So you can add extra glue / extensions / redirects / auth checks to various routes. Unfortunately you don't really proper granularity with the current frontend/app.rb because it combines the update and create operations into one.

This patch splits the operations into distinct routes, and redirects from update to create if the page doesn't exist.

There are a couple of reasons why it'd be really good to get this merged:
* The current route scheme is not resfull. Yeah yeah it still wouldn't be restful, but it'd be *more* resfull.
* If you're using route-preemption with Sinatra, you don't get sufficient granularity to do authorisation checks. So you can only only apply access controls on read/modify/delete instead of the full CRUD.
* One step closer to getting omnigollum working as a drop in gem. See example:[[http://wiki.luajit.org/edit/Home]]. It's really hard to run public wikis because of the spam edits, linking Gollum to an authentication system *dramatically* reduces the amount of spam.

Let me know what you guys think, or if you have alternative views on authentication with Sinatra/Gollum...