Add desktopcouch.ubuntuone module to access Ubuntu One CouchDBs from a Python library

Bug #672628 reported by Stuart Langridge
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntuone-couch
Fix Released
Undecided
Unassigned

Bug Description

After the desktopcouch.records split in bug #510159, using desktopcouch from a Python program will start with "from desktopcouch.records import CouchDatabase". There should be also a very similar interface to directly access Ubuntu One CouchDBs.

Entry point: "from desktopcouch.ubuntuone import CouchDatabase"

desktopcouch.ubuntuone.CouchDatabase should be a subclass of desktopcouch.records.CouchDatabase. It should attempt to retrieve an Ubuntu One access token from the keyring and use it for access. If no token, or no keyring, is available, then throw an error. It must be possible to pass a valid oauth token to the d.u1.CouchDatabase constructor (for use in server/webapp environments). (NB: this is already possible with the oauth_tokens parameter to CouchDatabase; this needs to be documented).

Note that there is a bug in desktopcouch.records overescaping slashes in URLs, so a request for contacts/_design/get_records_and_type really tries to access contacts%2F_design%2Fget_records_and_type. This works in desktopcouch because DC recognises the wrongness and issues a 302 redirect to the right URL; in Ubuntu One Couch it throws a 401, not a redirect.

Revision history for this message
Stuart Langridge (sil) wrote :

Note that desktopcouch.ubuntuone should go into a separate installable package, which should also contain ubuntuone-couchdb-query and ubuntuone-couchdb-replicate.

Revision history for this message
dobey (dobey) wrote :

Should perhaps this not be ubuntuone.desktopcouch instead? Should this perhaps also be instead provided by ubuntuone-client, rather than desktopcouch? Doing so would help keep a clearer separation between the two, and further the idea that ubuntuone-client is the basic client integration point for our services.

Revision history for this message
Stuart Langridge (sil) wrote :

This shouldn't be provided by ubuntuone-client; this module will be used by web apps that want to talk to your U1 CouchDBs on your behalf, and those webapps won't have ubuntuone-client. But the idea of putting this module under ubuntuone rather than under desktopcouch is a good one.

Changed in desktopcouch:
status: New → Confirmed
assignee: nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+)
importance: Undecided → Medium
Changed in desktopcouch (Ubuntu):
status: New → Confirmed
assignee: nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+)
Changed in desktopcouch (Ubuntu):
importance: Undecided → Wishlist
Changed in desktopcouch:
importance: Medium → Wishlist
Revision history for this message
dobey (dobey) wrote :

This functionality was provided by ubuntuone-couch, though as we migrate away from couchdb, as announced, it will become less useful.

no longer affects: desktopcouch (Ubuntu)
affects: desktopcouch → ubuntuone-couch
Changed in ubuntuone-couch:
assignee: Ubuntu One Desktop+ team (ubuntuone-desktop+) → nobody
importance: Wishlist → Undecided
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.