Confirmed users
358
edits
(→GET /) |
No edit summary |
||
| Line 5: | Line 5: | ||
== Delta-Sync Data Model == | == Delta-Sync Data Model == | ||
The storage server hosts a number of independent named '''collections''' for each user. Each collection is a key-value store whose contents can be atomically modified by the client. | The storage server hosts a number of independent named '''collections''' for each user. Each collection is a key-value store whose contents can be atomically modified by the client. Each modification of a collection creates a new '''version''' with corresponding version identifier, which is a signed hash of the contents of the collection at that version. | ||
More details at [[Identity/CryptoIdeas/04-Delta-Sync]]. | More details at [[Identity/CryptoIdeas/04-Delta-Sync]]. | ||
| Line 17: | Line 12: | ||
== Authentication == | == Authentication == | ||
To access the storage service, a client device must authenticate by | To access the storage service, a client device must authenticate by providing a BrowserID assertion and a Device ID. It will receive in exchange: | ||
* the current version number of each collection | |||
* a short-lived id/key pair that can be used to authenticate subsequent requests with Hawk | |||
* a URL to which further requests should be directed | * a URL to which further requests should be directed | ||
You can think of this as establishing a "login session" with the server | |||
You can think of this as establishing a "login session" with the server, although we're also tunneling some basic metadata in order to reduce the number of round-trips. | |||
Example: | Example: | ||
| Line 40: | Line 36: | ||
< "key": <hawk auth secret key>, | < "key": <hawk auth secret key>, | ||
< "collections": { | < "collections": { | ||
< " | < "bookmarks": <version id for bookmarks collection>, | ||
< "passwords": <version id for passwords collection>, | |||
< " | |||
< <...etc...> | < <...etc...> | ||
< } | < } | ||
| Line 63: | Line 52: | ||
=== GET <base-url> === | === GET <base-url> === | ||
Get the current | Get the current version id for all collections. This is the same data as returned in the session-establishment call above, but it may be useful if the client wants to refresh its view. Example: | ||
> GET <base-url> | > GET <base-url> | ||
| Line 72: | Line 61: | ||
< { | < { | ||
< "collections": { | < "collections": { | ||
< " | < "bookmarks": <version id for bookmarks collection>, | ||
< "passwords": <version id for passwords collection>, | |||
< " | |||
< <...etc...> | < <...etc...> | ||
< } | < } | ||
| Line 87: | Line 69: | ||
=== GET <base-url>/<collection> === | === GET <base-url>/<collection> === | ||
Get the current | Get the current version id for a specific collection. Example: | ||
> GET <base-url>/<collection> | > GET <base-url>/<collection> | ||
| Line 95: | Line 77: | ||
< Content-Type: application/json | < Content-Type: application/json | ||
< { | < { | ||
< "version": <version id | < "version": <version id for this collection> | ||
< } | < } | ||