diff options
Diffstat (limited to 'packages/meshbay-client/src/preload.js')
| -rw-r--r-- | packages/meshbay-client/src/preload.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/meshbay-client/src/preload.js b/packages/meshbay-client/src/preload.js index e3e240f..b649ae3 100644 --- a/packages/meshbay-client/src/preload.js +++ b/packages/meshbay-client/src/preload.js @@ -46,6 +46,16 @@ contextBridge.exposeInMainWorld('meshbay', { // which CORS refuses and which is not a credential anyway. fetch: (url, init) => ipcRenderer.invoke('hub:fetch', url, init), + // The device's hub key. Generated, held and used entirely in the main + // process: the interface asks for a signature and never sees a key, because + // it is the part of this application that parses hostile input. + device: { + ensure: () => ipcRenderer.invoke('device:ensure'), + publicKey: () => ipcRenderer.invoke('device:public'), + sign: (username) => ipcRenderer.invoke('device:sign', username), + forget: () => ipcRenderer.invoke('device:forget'), + }, + secrets: { get: (name) => ipcRenderer.invoke('secrets:get', name), set: (name, value) => ipcRenderer.invoke('secrets:set', name, value), |