Loop/Architecture/Context: Difference between revisions

Jump to navigation Jump to search
Line 31: Line 31:
== Loop Server API Changes ==
== Loop Server API Changes ==


From a Loop Server API perspective, this change is nothing more than mechanically replacing "roomName" with "context", "algo", and "key". The values of these fields are opaque to the server, and are simply stored as part of the room's information, and returned to clients when the room information is fetched.
From a Loop Server API perspective, this change is nothing more than mechanically replacing "roomName" with "context", which is a itself a structure containing three fields: "value", "alg", and "wrappedKey". The values of these fields are opaque to the server, and are simply stored as part of the room's information, and returned to clients when the room information is fetched.


Note that there will be a transition period during which rooms that were created prior to the introduction of encrypted context will contain a "roomName" field instead of the three new fields. The server will need to deal with this transition gracefully. The server may assume, but is not required to enforce, the constraint that "roomName" will never appear in a room alongside any of the other three fields.
Note that there will be a transition period during which rooms that were created prior to the introduction of encrypted context will contain a "roomName" field instead of "context". The server will need to deal with this transition gracefully. The server may assume, but is not required to enforce, the constraint that "roomName" will never appear in a room alongside "context".


For the sake of efficiency, the Loop server can also safely assume that the "context" and "key" fields are Base64 encoded. This allows, for example, decoding them and storing them as more compact binary fields. The resulting binary data will have very low entropy, so any attempts to compress the information will likely be futile.
For the sake of efficiency, the Loop server can also safely assume that the "value" and "wrappedKey" fields are Base64 encoded. This allows, for example, decoding them and storing them as more compact binary fields. The resulting binary data will have very low entropy, so any attempts to compress the information will likely be futile.


As a final note about context information: the current UX calls for this context information to include small image thumbnails as part of the context. This means that context data for a single room will likely be on the order of 20 to 30kB in size, on average.
As a final note about context information: the current UX calls for this context information to include small image thumbnails as part of the context. This means that context data for a single room will likely be on the order of 20 to 30kB in size, on average.
Line 50: Line 50:
    
    
  {
  {
     "context": "PWjHj89HBS-Hnd4YBoOXFlnqnJ3iqPPIX8XCnjEWT7Zc8Yhv7nch1aGA5kBlDwM0tvByMqHdbTthvEqRMUv60tnORRYOgRK-N3evEHCajcraSAU_BlItizKh68nQHO4P1A5vUTcvkbly4p1mRYKsVoSXti2zG7cFUqX1Iid7vpzq9t7kNXzxb7Ik9Hs1iXKOfVWPQZg6mRoH_-bTh_EMehxPgDCnMDLTDrqpa1-xuE9RDWNLgCMQmeFvE1rtYOGVPRt_WP6ivyJsmYv9fMTZxvcISwHcgadkdhQB8GXwsz8HTigFZk_bRDL-UykzRVPtce_FA2VkCmiF5nPCE4_kRcvs5PLwC3OJ0vjt1pG0_DQmudxpcuV-uYCxLG9pmXkWEFzshJRkir4OxC1485jh8ubINdweDzTb-KBp4y69G2lyT8A7GsC5o4kIhgLfSsEJ6UmeZeyMICUX3Iqd9ZsfDNLoUeAb5KGJgEtDy-7ag52rYY5mGgP2GQ==",
     "context": {
    "algo": "AES-GCM",
      "value": "PWjHj89HBS-Hnd4YBoOXFlnqnJ3iqPPIX8XCnjEWT7Zc8Yhv7nch1aGA5kBlDwM0tvByMqHdbTthvEqRMUv60tnORRYOgRK-N3evEHCajcraSAU_BlItizKh68nQHO4P1A5vUTcvkbly4p1mRYKsVoSXti2zG7cFUqX1Iid7vpzq9t7kNXzxb7Ik9Hs1iXKOfVWPQZg6mRoH_-bTh_EMehxPgDCnMDLTDrqpa1-xuE9RDWNLgCMQmeFvE1rtYOGVPRt_WP6ivyJsmYv9fMTZxvcISwHcgadkdhQB8GXwsz8HTigFZk_bRDL-UykzRVPtce_FA2VkCmiF5nPCE4_kRcvs5PLwC3OJ0vjt1pG0_DQmudxpcuV-uYCxLG9pmXkWEFzshJRkir4OxC1485jh8ubINdweDzTb-KBp4y69G2lyT8A7GsC5o4kIhgLfSsEJ6UmeZeyMICUX3Iqd9ZsfDNLoUeAb5KGJgEtDy-7ag52rYY5mGgP2GQ==",
    "key": "KLPCJEy8vewUeHFFLtvMNA",
      "alg": "AES-GCM",
      "wrappedKey": "KLPCJEy8vewUeHFFLtvMNA"
    },
     "expiresIn": 5,
     "expiresIn": 5,
     "roomOwner": "Alexis",
     "roomOwner": "Alexis",
Line 58: Line 60:
  }
  }


* '''context''' - The room context information, encrypted and Base64 encoded.
* '''context.value''' - The room context information, encrypted and Base64 encoded.
* '''algo''' - The encryption algorithm used to encrypt the context information.
* '''context.alg''' - The encryption algorithm used to encrypt the context information.
* '''key''' - The room key ('''kR'''), wrapped by the user's application-specific key '''kBr'''.
* '''context.wrappedKey''' - The room key ('''kR'''), wrapped by the user's application-specific key '''kBr'''.
* '''expiresIn''' - The number of hours for which the room will exist.
* '''expiresIn''' - The number of hours for which the room will exist.
* '''roomOwner''' - The user-friendly display name indicating the name of the room's owner.
* '''roomOwner''' - The user-friendly display name indicating the name of the room's owner.
Confirmed users
632

edits

Navigation menu