@dotrino/vaultd 0.193.1 → 0.193.3
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/lib/src/core/approvals.js +5 -4
- package/lib/src/core/libVersion.js +1 -1
- package/lib/src/core/vault.js +1 -1
- package/package.json +1 -1
- package/src/tui/app.js +13 -2
|
@@ -126,11 +126,12 @@ export function createApprovals ({ now = Date.now, pendingTtlMs = PENDING_TTL_MS
|
|
|
126
126
|
* La llave es cajón + aparato + huella del comando. Nada de esto se escribe en disco.
|
|
127
127
|
*/
|
|
128
128
|
export function createGrants ({ now = Date.now, ttlMs = GRANT_TTL_MS } = {}) {
|
|
129
|
-
/** key → { id, ns, device, deviceId, fp, ctx, by, grantedAt, lastAt, exp, uses } */
|
|
129
|
+
/** key → { id, ns, device, deviceId, label, fp, ctx, by, grantedAt, lastAt, exp, uses } */
|
|
130
130
|
const grants = new Map()
|
|
131
131
|
const keyOf = (ns, device, fp) => ns + SEP + device + SEP + fp
|
|
132
132
|
const publicOf = (g) => ({
|
|
133
|
-
|
|
133
|
+
// El aparato con su ALIAS además del ID (dueño, 2026-11-05: «debe mostrar el ID y el alias, ambos»).
|
|
134
|
+
id: g.id, ns: g.ns, deviceId: g.deviceId, label: g.label || '', fp: g.fp, ctx: g.ctx,
|
|
134
135
|
by: g.by, grantedAt: g.grantedAt, lastAt: g.lastAt, exp: g.exp, uses: g.uses
|
|
135
136
|
})
|
|
136
137
|
|
|
@@ -140,11 +141,11 @@ export function createGrants ({ now = Date.now, ttlMs = GRANT_TTL_MS } = {}) {
|
|
|
140
141
|
* traía comando: sin huella no hay nada que recordar, y el próximo pedido volverá a
|
|
141
142
|
* timbrar. Que eso se diga en el log es cosa de quien llama.
|
|
142
143
|
*/
|
|
143
|
-
grant ({ ns, device, deviceId = null, ctx = null, by = null }) {
|
|
144
|
+
grant ({ ns, device, deviceId = null, label = '', ctx = null, by = null }) {
|
|
144
145
|
const fp = commandFingerprint(ctx)
|
|
145
146
|
if (!fp) return null
|
|
146
147
|
const t = now()
|
|
147
|
-
const g = { id: rnd(), ns, device, deviceId, fp, ctx, by, grantedAt: t, lastAt: t, exp: t + ttlMs, uses: 0 }
|
|
148
|
+
const g = { id: rnd(), ns, device, deviceId, label, fp, ctx, by, grantedAt: t, lastAt: t, exp: t + ttlMs, uses: 0 }
|
|
148
149
|
grants.set(keyOf(ns, device, fp), g)
|
|
149
150
|
return publicOf(g)
|
|
150
151
|
},
|
package/lib/src/core/vault.js
CHANGED
|
@@ -2285,7 +2285,7 @@ export async function startVault ({ platform, proxyUrl, log = console.log, onEnr
|
|
|
2285
2285
|
// las siguientes veces que lo pida ESE MISMO comando desde ESA MISMA carpeta. Un pedido
|
|
2286
2286
|
// que no dijo qué corría no deja nada anotado, y se dice por qué: si no, el dueño vería
|
|
2287
2287
|
// que unos pedidos dejan de timbrar y otros no, sin ninguna explicación a mano.
|
|
2288
|
-
const grant = grants.grant({ ns: pend.ns, device: pend.device, deviceId: pend.deviceId, ctx: pend.ctx, by })
|
|
2288
|
+
const grant = grants.grant({ ns: pend.ns, device: pend.device, deviceId: pend.deviceId, label: pend.label || '', ctx: pend.ctx, by })
|
|
2289
2289
|
audit('secrets.approved', { device: pend.deviceId, ns: pend.ns, id, by, ...(grant ? { grant: grant.id } : {}) })
|
|
2290
2290
|
noteAnswered(pend, 'approved', by, chk.device)
|
|
2291
2291
|
log(`[vault] ${pend.ns}: request of ${pend.deviceId} approved by ${by}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/vaultd",
|
|
3
|
-
"version": "0.193.
|
|
3
|
+
"version": "0.193.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Certificador personal de Dotrino: daemon headless que custodia la clave maestra y delega capacidades a tus dispositivos por el proxy. Tu CA propia.",
|
|
6
6
|
"bin": {
|
package/src/tui/app.js
CHANGED
|
@@ -1046,6 +1046,12 @@ function autoLockWakeIn (st, now = Date.now()) {
|
|
|
1046
1046
|
* reabriría sola en cuanto alguien pulsara Enter (ver `reunlockSilently`), así que el
|
|
1047
1047
|
* candado del daemon no habría cerrado nada.
|
|
1048
1048
|
*/
|
|
1049
|
+
/**
|
|
1050
|
+
* ¿Esta «tecla» la pulsó alguien? `tick` es el despertar del sondeo y `resize` lo manda el
|
|
1051
|
+
* terminal: ninguno de los dos es una persona delante, así que no estiran el candado.
|
|
1052
|
+
*/
|
|
1053
|
+
const isUse = (key) => key?.name !== 'tick' && key?.name !== 'resize'
|
|
1054
|
+
|
|
1049
1055
|
/** Cada cuánto se le dice al daemon «sigo aquí». Muy por debajo del plazo del candado. */
|
|
1050
1056
|
const TOUCH_MS = 60_000
|
|
1051
1057
|
let lastTouch = 0
|
|
@@ -3279,7 +3285,12 @@ export async function handleKey (term, st, key) {
|
|
|
3279
3285
|
// navegando esta pantalla y se cerraba igual, que es lo contrario de lo que se
|
|
3280
3286
|
// quería. Se avisa como mucho una vez por minuto —el plazo son cinco, así que
|
|
3281
3287
|
// sobra— para no escribir un archivo por tecla.
|
|
3282
|
-
|
|
3288
|
+
//
|
|
3289
|
+
// SOLO UNA TECLA DE VERDAD. Aparatos, emparejamiento y unirse se despiertan solos cada
|
|
3290
|
+
// 800 ms con un `tick` para sondear; contarlo como uso dejaba la bóveda abierta para
|
|
3291
|
+
// siempre con la pantalla quieta (dueño, 2026-11-11: «lo mantiene abierto solo mientras
|
|
3292
|
+
// haya acciones»).
|
|
3293
|
+
if (isUse(key)) stayHere(st)
|
|
3283
3294
|
|
|
3284
3295
|
const ch = key.name === 'char' ? key.ch.toLowerCase() : null
|
|
3285
3296
|
// 'q' global sale — preguntando antes si hay permisos sin guardar.
|
|
@@ -3378,4 +3389,4 @@ export async function runTui () {
|
|
|
3378
3389
|
}
|
|
3379
3390
|
|
|
3380
3391
|
// Solo para pruebas headless (render sin terminal real). No usar en runtime.
|
|
3381
|
-
export const __test = { checkForUpdate, offerUpdate, installUpdate, render, settingsRows, onKeySettings, doorRows, onKeyDoors, pairCapsRows, onKeyPairCaps, onKeyDevices, draftChanges, saveCapsDrafts, onKeySecrets, loginRows, onKeyLogins, refreshLogins, activeLocked, autoLockedIds, autoLockWakeIn, forgetAutoLocked, autoLockMin, refreshAll, ensureUnlocked, profileRows, deviceRows, secretRows, devVarRows, meRows, capsRows, onKeyCaps, pairModeRows, pairingBody, scrollBody, fitHelp, wrapHelp, wrapWords, joinBody, onKeyJoin, promptJoin, onKeyProfiles, onInputKey, toggleLang, mergeMembersAndCerts, seguirAqui: stayHere, backupRows, backupPlanRows, onKeyBackup, onKeyBackupPlan, resetToque: () => { lastTouch = 0 } }
|
|
3392
|
+
export const __test = { checkForUpdate, offerUpdate, installUpdate, render, settingsRows, onKeySettings, doorRows, onKeyDoors, pairCapsRows, onKeyPairCaps, onKeyDevices, draftChanges, saveCapsDrafts, onKeySecrets, loginRows, onKeyLogins, refreshLogins, activeLocked, autoLockedIds, autoLockWakeIn, forgetAutoLocked, autoLockMin, refreshAll, ensureUnlocked, profileRows, deviceRows, secretRows, devVarRows, meRows, capsRows, onKeyCaps, pairModeRows, pairingBody, scrollBody, fitHelp, wrapHelp, wrapWords, joinBody, onKeyJoin, promptJoin, onKeyProfiles, onInputKey, toggleLang, mergeMembersAndCerts, seguirAqui: stayHere, isUse, backupRows, backupPlanRows, onKeyBackup, onKeyBackupPlan, resetToque: () => { lastTouch = 0 } }
|