Services/Sync/Server/Archived/0.3/API/Payloads

From MozillaWiki
< Services‎ | Sync‎ | Server‎ | Archived‎ | 0.3/API(Redirected from Labs/Weave/0.3/API/Payloads)
Jump to: navigation, search

Payloads

Payloads are a hash with a required "type" key that defines the object type of the payload. Other keys will be required based on this type.

Here are some defined Payload Structures:

Bookmarks

(needs defining)

History

(needs defining)

Private Key

Public Key payloads must be unencrypted. Note that the key itself is still passphrase protected.

Parameter Default Description
key_data required The private key, passphrase encrypted.
public_key required The URI to the public key associated with this private key.

Sample

  "payload": 
  {
    "type": "private_key",
    "key_data": "nviuwc023nd210o3idn120x283cm...",
    "public_key": "A24349145-5AB-2YX-9526"
  }


Public Key

Public Key objects must be unencrypted.

Parameter Default Description
key_data required The public key
private_key required The URI to the private key associated with this private key.

Sample

  "payload": 
  {
    "type": "public_key",
    "key_data": "nviuwc023nd210o3idn120x283cm...",
    "private_key": "B24349145-5AB-2YX-9526"
  }

Cryptometa

Cryptometa objects must be unencrypted.

Parameter Default Description
algorithm required A hash, containing a "name" key and associated value, and any additional data required for the algorithm, such as "salt" or "iv".
keyring empty A hash in which the keys are URLs to publickey WERs and the values are the encryption string used with that key to encrypt this record. The keys may be fully qualified URLs, or relative to the id level (thus, just the id is acceptable)

Sample

  "payload": 
  {
    "type": "cryptometa",
    "algorithm": 
    {
      "name": "aes-256-cbc",
      "salt": "234imasd9f8w23m7",
      "iv": "2w3kmv9821maz985"
    }
    "keyring": 
    {
	  "B24349145-5AB-2YX-9526": "m29f2mnvwiecvnw0ev...",
    }
  }