@dotrino/terminal-agent 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +2 -2
- package/link.js +5 -2
- package/package.json +2 -2
package/bin/cli.js
CHANGED
|
@@ -35,7 +35,7 @@ datos en ${dataDir()} (override DOTRINO_TERMINAL_DIR)`)
|
|
|
35
35
|
async function doEnroll (dir) {
|
|
36
36
|
console.log('Enlazar esta máquina con tu vault.')
|
|
37
37
|
console.log('El código lo generas en tu bóveda. Hay dos formas:')
|
|
38
|
-
console.log(' · Sin vault externo → abre https://profile.dotrino.com
|
|
38
|
+
console.log(' · Sin vault externo → abre https://profile.dotrino.com/myvault,')
|
|
39
39
|
console.log(' activa la bóveda y pulsa "Generar código de emparejamiento"; copia el código.')
|
|
40
40
|
console.log(' · Con vault en un PC → ahí corre `dotrino-vault pair` y copia el QR/JSON.\n')
|
|
41
41
|
const text = await ask('Pega el código y Enter:\n> ')
|
|
@@ -49,7 +49,7 @@ async function doEnroll (dir) {
|
|
|
49
49
|
console.log('\n Escribe ESTE código en tu bóveda para aprobar esta máquina:')
|
|
50
50
|
console.log(` código: ${code}`)
|
|
51
51
|
console.log(` máquina: ${deviceId}`)
|
|
52
|
-
console.log(' (en profile.dotrino.com
|
|
52
|
+
console.log(' (en profile.dotrino.com/myvault escríbelo en el campo y pulsa "Aprobar";')
|
|
53
53
|
console.log(` en el PC del vault: dotrino-vault approve ${code})\n`)
|
|
54
54
|
console.log(' Esperando aprobación…')
|
|
55
55
|
}
|
package/link.js
CHANGED
|
@@ -13,7 +13,7 @@ import fs from 'node:fs'
|
|
|
13
13
|
import path from 'node:path'
|
|
14
14
|
import os from 'node:os'
|
|
15
15
|
import {
|
|
16
|
-
makeDeviceKey, signWithDevice, verifyDelegation, makePairingCode, pubkeyId
|
|
16
|
+
makeDeviceKey, signWithDevice, verifyDelegation, makePairingCode, commitCode, pubkeyId
|
|
17
17
|
} from '@dotrino/identity/capabilities'
|
|
18
18
|
import { installNodeGlobals } from './node-globals.js'
|
|
19
19
|
|
|
@@ -85,7 +85,10 @@ export async function enroll ({ qr, label = 'terminal-agent', dir = dataDir(), o
|
|
|
85
85
|
// lo mostramos y NO lo enviamos. La bóveda lo aprende solo cuando un humano lo tipea
|
|
86
86
|
// y nos lo ECHA de vuelta → así aprobar exige TENER esta máquina (de aquí sale el código).
|
|
87
87
|
const code = makePairingCode()
|
|
88
|
-
|
|
88
|
+
// El COMPROMISO del código (nunca el código): la bóveda lo recompone con lo que
|
|
89
|
+
// tipeas y solo entonces firma el cert → aprobar exige haber leído esta pantalla.
|
|
90
|
+
const commit = await commitCode({ code, dpub: device.publickey, sn: qr.sn })
|
|
91
|
+
const data = { op: 'enroll', dpub: device.publickey, token: qr.token, sn: qr.sn, commit, label, ts: Date.now() }
|
|
89
92
|
const { signature } = await signWithDevice({ privateJwk: device.privateJwk, data })
|
|
90
93
|
|
|
91
94
|
const done = new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/terminal-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Agente de Dotrino Terminal: abre una shell (PTY) en la máquina del vault solo para el dispositivo enlazado, vía @dotrino/tunnel y cifrado E2E.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"start": "node bin/cli.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dotrino/identity": "0.
|
|
16
|
+
"@dotrino/identity": "0.23.0",
|
|
17
17
|
"@dotrino/proxy-client": "0.6.4",
|
|
18
18
|
"@homebridge/node-pty-prebuilt-multiarch": "0.14.1-beta.2",
|
|
19
19
|
"ws": "8.21.0"
|