Cotton code
144 lines · 3.6 KB · JSONRaw
{  "format_version": 1,  "id": "vault_key",  "name": "Device key",  "plural": "Device keys",  "visibility": "owner",  "title": "name",  "date": "created_at",  "columns": [    {      "key": "device_id",      "name": "Device",      "type": "text",      "required": true,      "readonly": true    },    {      "key": "name",      "name": "Name",      "type": "text"    },    {      "key": "public_key",      "name": "Public key",      "type": "text",      "required": true,      "readonly": true    },    {      "key": "fingerprint",      "name": "Fingerprint",      "type": "text",      "readonly": true    },    {      "key": "wrapped_vmk",      "name": "Wrapped vault key",      "type": "longtext",      "readonly": true,      "hidden": true    },    {      "key": "vmk_version",      "name": "Vault key version",      "type": "number",      "readonly": true,      "hidden": true    },    {      "key": "created_at",      "name": "Asked",      "type": "date",      "format": "calendar-datetime",      "readonly": true    }  ],  "instructions": "One row per device that asks to open the owner's vault: device_id the device, name what it calls itself, public_key its X25519 public half (base64url), which it publishes itself. fingerprint is the public half's fingerprint (four groups of four hex digits), computed by each phone and never stored: the owner checks it against the asking device's own screen before approving. wrapped_vmk is the vault master key wrapped for that public half, written by one of the owner's devices that already holds the vault when the owner approves this one, and empty until then: such a row is waiting for approval. vmk_version is the version of the key it was wrapped at. Neither half opens anything without the device's own private key, which never leaves it. Never write a column by hand. Approve lets a waiting device in (the phone asks for Face ID or its passcode, then opens the vault for that one approval); Refuse removes its request.",  "slip": {    "title": "name",    "subtitle": "fingerprint",    "trailing": "created_at",    "photo": null,    "toggle": null  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "name",        "fingerprint",        "device_id",        "created_at"      ]    }  ],  "card": {    "face": "plain",    "fields": [      {        "slot": "title",        "column": "name"      },      {        "slot": "subtitle",        "column": "fingerprint"      },      {        "slot": "facts",        "column": "device_id",        "also": [          "created_at"        ]      }    ]  },  "sort": {    "column": "vmk_version",    "descending": false,    "tie": "created_at",    "tie_descending": false  },  "add": false,  "empty": {    "title": "No devices yet",    "message": "A Mac or phone that asks to open your vault waits here for you to approve it."  },  "commands": [    {      "id": "approve",      "label": "Approve",      "kind": "update",      "method": "vault.approveDevice",      "bindings": {        "deviceId": "device_id"      },      "when": {        "vmk_version": 0      },      "receipt": "Approved",      "does": "completes",      "object": "stamp"    },    {      "id": "refuse",      "label": "Refuse",      "object": "tray",      "kind": "update",      "method": "vault.refuseDevice",      "bindings": {        "deviceId": "device_id"      },      "when": {        "vmk_version": 0      },      "receipt": "Refused",      "does": "puts-away",      "destructive": true,      "confirm": "This device will not open your vault. It can ask again."    }  ]}