JavaScript + OAuth guru? We need to make OAuth AJAX requests to CouchDB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Dmedia |
Fix Released
|
High
|
Jason Gerard DeRose |
Bug Description
Stuart Langridge said that if I use basic auth instead of OAuth to talk to desktopcouch, he will be very very cross with me!
Both dmedia (and Novacut) will use HTML5 user interfaces that make AJAX requests to CouchDB. This is cool because it allows us to 1) use familiar, productive web technologies that countless designers already know, and 2) run basically the same user interface whether hosted on a server or running as a WebKitGtk/QtWebKit local application.
desktopcouch configures its CouchDB instance to use OAuth (which is a good thing). Dirty little secret is desktopcouch also accepts basic auth (that's how firefox ~/.local/
Things will work like this:
1) When the dmedia service starts, it with get the OAuth credentials from gnomekeyring and insert them as JavaScript variables in the Genshi template
2) When the UI needs to make a request to CouchDB (it will all be AJAX), some yet to be written JavaScript signs the OAuth request client-side no one gets scolded
Over time I will make this component into something very generic that can be used by dmedia, Novacut, or other desktopcouch apps that want to talk to CouchDB with direct AJAX requests.
Changed in dmedia: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 0.2 |
tags: | added: couchdb javascript oath |
tags: | added: desktopcouch |
Changed in dmedia: | |
assignee: | nobody → Jason Gerard DeRose (jderose) |
status: | Triaged → In Progress |
Changed in dmedia: | |
status: | In Progress → Fix Committed |
Changed in dmedia: | |
status: | Fix Committed → In Progress |
Changed in dmedia: | |
status: | Fix Committed → Fix Released |
I did some basic research.
Since computers are shared between many users, the concept of fixed port cannot work since every user has it's own desktopcouch instance. For this the port number of RESTful web service has to be known via dbus. If the bus is not running, it is activated
>> import dbus SessionBus( ) get_object( 'org.desktopcou ch.CouchDB' , '/')
>> bus=dbus.
>> proxy=bus.
>> z=proxy.getPort()
>> z
dbus.Int32(54191)
>> int(z)
54191
So 54191 is the port number on which the RESTful web service runs.