@dotrino/terminal-agent 0.2.13 → 0.2.15
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/link.js +5 -2
- package/package.json +10 -5
- package/tsconfig.json +39 -0
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.15",
|
|
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": {
|
|
@@ -10,13 +10,18 @@
|
|
|
10
10
|
".": "./index.js"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"start": "node bin/cli.js"
|
|
13
|
+
"start": "node bin/cli.js",
|
|
14
|
+
"type-check": "tsc --noEmit"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
|
-
"@dotrino/identity": "0.
|
|
17
|
-
"@dotrino/proxy-client": "0.
|
|
17
|
+
"@dotrino/identity": "0.53.0",
|
|
18
|
+
"@dotrino/proxy-client": "0.10.1",
|
|
18
19
|
"@homebridge/node-pty-prebuilt-multiarch": "0.14.1-beta.2",
|
|
19
20
|
"ws": "8.21.0"
|
|
20
21
|
},
|
|
21
|
-
"license": "MIT"
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "5.9.3",
|
|
25
|
+
"@types/node": "^22.0.0"
|
|
26
|
+
}
|
|
22
27
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": [
|
|
7
|
+
"ES2022",
|
|
8
|
+
"DOM"
|
|
9
|
+
],
|
|
10
|
+
"allowJs": true,
|
|
11
|
+
"checkJs": true,
|
|
12
|
+
"strict": false,
|
|
13
|
+
"noImplicitAny": false,
|
|
14
|
+
"strictNullChecks": false,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"baseUrl": ".",
|
|
19
|
+
"noEmit": true,
|
|
20
|
+
"types": [
|
|
21
|
+
"node"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"include": [
|
|
25
|
+
"src/**/*.js",
|
|
26
|
+
"src/**/*.mjs",
|
|
27
|
+
"src/**/*.d.ts",
|
|
28
|
+
"bin/**/*.js",
|
|
29
|
+
"server.js",
|
|
30
|
+
"index.js"
|
|
31
|
+
],
|
|
32
|
+
"exclude": [
|
|
33
|
+
"node_modules",
|
|
34
|
+
"dist",
|
|
35
|
+
"coverage",
|
|
36
|
+
"**/*.test.*",
|
|
37
|
+
"**/*.spec.*"
|
|
38
|
+
]
|
|
39
|
+
}
|