@dotrino/vaultd 0.194.2 → 0.195.0
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/libVersion.js +1 -1
- package/lib/src/core/passwords.js +38 -0
- package/lib/src/core/vault.js +27 -0
- package/package.json +2 -2
- package/src/ctl.js +50 -0
- package/src/daemon.js +6 -2
- package/src/tui/app.js +93 -4
- package/src/tui/i18n.js +60 -2
- package/src/vaultControl.js +8 -0
|
@@ -202,3 +202,41 @@ export async function importPasswordEntries ({ sealed, openRecovery, recipients,
|
|
|
202
202
|
}
|
|
203
203
|
return { written }
|
|
204
204
|
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* ¿QUÉ HAY GUARDADO PARA ESTE SITIO, Y QUIÉN LO ABRE? (`dotrino-vault passwords find`).
|
|
208
|
+
*
|
|
209
|
+
* **Solo lee**: ni reenvuelve ni escribe. La huella del sitio sale de la llave del perfil, que
|
|
210
|
+
* se abre con la copia de recuperación (`openRecovery`, bóveda abierta), y con ella se pide al
|
|
211
|
+
* almacén `inspect`. De cada entrada se abre su VISTA —título, usuario, sitios—, nunca un valor.
|
|
212
|
+
*
|
|
213
|
+
* Devuelve las públicas tal cual (`by`, `holders`, `missing`): ponerles nombre es de quien
|
|
214
|
+
* tiene el acta.
|
|
215
|
+
*/
|
|
216
|
+
export async function findPasswordEntries ({ sealed, openRecovery, query }) {
|
|
217
|
+
const { hostOf } = await import('@dotrino/passmanager/match')
|
|
218
|
+
if (!hostOf(String(query || ''))) throw Object.assign(new Error('that is not a site: give a domain or a URL'), { code: 'BAD_SITE' })
|
|
219
|
+
const stats = await sealed.stats()
|
|
220
|
+
if (!stats.sealed) return { sealed: false, entries: stats.entries, found: [] }
|
|
221
|
+
const { RECOVERY, profileKeys, siteHashes, passkeyRpHashes, openSealedView } = await import('@dotrino/passmanager/sealed')
|
|
222
|
+
const { decryptWithCek } = await import('@dotrino/identity/content')
|
|
223
|
+
let prof
|
|
224
|
+
try { prof = await sealed.profile({ pub: RECOVERY }) } catch (e) {
|
|
225
|
+
if (e?.code !== 'not-yours') throw e
|
|
226
|
+
throw Object.assign(new Error('the password profile key has no recovery wrap: open the vault so it gets one'), { code: 'NO_RECOVERY' })
|
|
227
|
+
}
|
|
228
|
+
const openSealed = async ({ wrap, envelope }) => decryptWithCek({ cek: await openRecovery(wrap), envelope })
|
|
229
|
+
const keys = await profileKeys(await openSealed({ wrap: prof.wrap, envelope: prof.envelope }))
|
|
230
|
+
const hits = await sealed.inspect({ idx: await siteHashes(keys.kidx, query), rp: await passkeyRpHashes(keys.kidx, query) })
|
|
231
|
+
const found = []
|
|
232
|
+
for (const h of hits) {
|
|
233
|
+
let view = null
|
|
234
|
+
if (h.recoveryWrap) {
|
|
235
|
+
const v = await openSealedView({ view: h.view, wrap: h.recoveryWrap, id: h.id, openSealed })
|
|
236
|
+
view = { title: v.title || '', user: v.hint || '', sites: v.sites || [], rpId: v.webauthn?.rpId || null, hasSecret: !!v.has?.secret, hasTotp: !!v.has?.totp }
|
|
237
|
+
}
|
|
238
|
+
const { view: _sealedView, recoveryWrap: _w, ...meta } = h
|
|
239
|
+
found.push({ ...meta, view })
|
|
240
|
+
}
|
|
241
|
+
return { sealed: true, entries: stats.entries, found }
|
|
242
|
+
}
|
package/lib/src/core/vault.js
CHANGED
|
@@ -4752,6 +4752,32 @@ export async function startVault ({ platform, proxyUrl, log = console.log, onEnr
|
|
|
4752
4752
|
const { exportPasswordEntries } = await import('./passwords.js')
|
|
4753
4753
|
return exportPasswordEntries({ sealed: await sealedPasswords(), openRecovery: passwordsRecovery(adminKey) })
|
|
4754
4754
|
}
|
|
4755
|
+
/**
|
|
4756
|
+
* ¿HAY UNA CONTRASEÑA O PASSKEY PARA ESTE SITIO, Y LA TIENEN TODOS LOS APARATOS? Lo que
|
|
4757
|
+
* pide la consola para comprobar que algo se guardó y se repartió (2026-11-23).
|
|
4758
|
+
*
|
|
4759
|
+
* **Solo lee.** No reenvuelve, no convierte, no escribe: si falta una envoltura se DICE, y
|
|
4760
|
+
* se arregla aparte (abrir la bóveda o `rewrapAll`). Bóveda abierta, como el respaldo: la
|
|
4761
|
+
* huella del sitio sale de la llave del perfil, y esa solo la abre la frase.
|
|
4762
|
+
*
|
|
4763
|
+
* De cada entrada sale la vista (título, usuario, sitios), nunca un valor.
|
|
4764
|
+
*/
|
|
4765
|
+
async function findPasswords (query, { adminKey } = {}) {
|
|
4766
|
+
needOpen()
|
|
4767
|
+
const { findPasswordEntries } = await import('./passwords.js')
|
|
4768
|
+
const r = await findPasswordEntries({ sealed: await sealedPasswords(), openRecovery: passwordsRecovery(adminKey), query })
|
|
4769
|
+
const who = async (pub) => {
|
|
4770
|
+
const m = (actaCache?.members || []).find((x) => x.pub === pub)
|
|
4771
|
+
return { id: await pubkeyId(pub), label: m?.label || m?.cn || null }
|
|
4772
|
+
}
|
|
4773
|
+
for (const f of r.found) {
|
|
4774
|
+
f.by = f.by ? await who(f.by) : null
|
|
4775
|
+
f.holders = await Promise.all(f.holders.map(who))
|
|
4776
|
+
f.missing = await Promise.all(f.missing.map(who))
|
|
4777
|
+
}
|
|
4778
|
+
return r
|
|
4779
|
+
}
|
|
4780
|
+
|
|
4755
4781
|
/** Cómo se llama un cajón para quien lo lee: el del aparato, con su ID y su nombre. */
|
|
4756
4782
|
const drawerLabel = (owner) => {
|
|
4757
4783
|
if (!owner.startsWith('dev:')) return null
|
|
@@ -5246,6 +5272,7 @@ export async function startVault ({ platform, proxyUrl, log = console.log, onEnr
|
|
|
5246
5272
|
setSecret, deleteSecret, renameSecret, renameDeviceSecret, listSecrets, setSecretVisibility, openSecrets,
|
|
5247
5273
|
// El respaldo: exportar, ver el plan e importar. Las tres con la bóveda abierta.
|
|
5248
5274
|
backupDrawers, exportBackup, planBackupImport, importBackup,
|
|
5275
|
+
findPasswords,
|
|
5249
5276
|
// Sella un `secrets.json` v3 entero. Es el punto de no retorno del despliegue y
|
|
5250
5277
|
// por eso es una operación con nombre propio, no algo que ocurra de refilón al
|
|
5251
5278
|
// desbloquear: deja `secrets.json.v3.bak` para poder volver.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/vaultd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.195.0",
|
|
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": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@dotrino/compat": "0.5.0",
|
|
25
25
|
"@dotrino/identity": "0.139.0",
|
|
26
26
|
"@dotrino/opaque": "0.1.0",
|
|
27
|
-
"@dotrino/passmanager": "0.
|
|
27
|
+
"@dotrino/passmanager": "0.19.0",
|
|
28
28
|
"@dotrino/proxy-client": "^0.47.0",
|
|
29
29
|
"@dotrino/roadmap": "0.4.89",
|
|
30
30
|
"@dotrino/store": "0.13.0",
|
package/src/ctl.js
CHANGED
|
@@ -2611,6 +2611,10 @@ function help () {
|
|
|
2611
2611
|
privada, y una privada NO se vuelve pública.
|
|
2612
2612
|
secret visibility <ns> <CLAVE> private tapa una pública sin tocar el valor
|
|
2613
2613
|
secret device visibility <ID> <CLAVE> private
|
|
2614
|
+
passwords find <dominio>
|
|
2615
|
+
si hay contraseña o passkey para ese sitio (y sus subdominios),
|
|
2616
|
+
con su usuario, y qué aparatos la abren o todavía no. No enseña
|
|
2617
|
+
la contraseña ni cambia nada. Bóveda abierta
|
|
2614
2618
|
backup list qué cajones hay para respaldar (nombres y cuántos valores)
|
|
2615
2619
|
backup export [cajón…] [-o archivo]
|
|
2616
2620
|
un archivo cifrado con una contraseña propia, con los valores de
|
|
@@ -2785,6 +2789,51 @@ async function cmdReplica (args) {
|
|
|
2785
2789
|
process.exit(2)
|
|
2786
2790
|
}
|
|
2787
2791
|
|
|
2792
|
+
/**
|
|
2793
|
+
* `dotrino-vault passwords find <dominio>`: ¿hay contraseña o passkey para ese sitio, y la
|
|
2794
|
+
* pueden abrir todos los aparatos con `passwords`? Solo lee: no cambia nada del almacén.
|
|
2795
|
+
* Enseña título, usuario y sitios; nunca un valor.
|
|
2796
|
+
*/
|
|
2797
|
+
async function cmdPasswords (rest) {
|
|
2798
|
+
const [sub, query] = rest
|
|
2799
|
+
if (sub !== 'find' || !query) {
|
|
2800
|
+
console.error('uso: dotrino-vault passwords find <dominio o URL>')
|
|
2801
|
+
process.exit(2)
|
|
2802
|
+
}
|
|
2803
|
+
const r = await backupRequest({ op: 'passwords-find', query }).catch((e) => {
|
|
2804
|
+
if (e.code === 'BAD_SITE') { console.error('«%s» no es un sitio: escribe un dominio (ejemplo.com) o una URL.', query); process.exit(2) }
|
|
2805
|
+
if (e.code === 'NO_RECOVERY') { console.error('La llave de las contraseñas todavía no tiene la copia de la frase. Abre la bóveda (dotrino-vault unlock) para que la reciba.'); process.exit(1) }
|
|
2806
|
+
return backupFail(e)
|
|
2807
|
+
})
|
|
2808
|
+
if (!r.sealed) {
|
|
2809
|
+
console.log(r.entries ? 'Las contraseñas están en el formato viejo: abre la bóveda para convertirlas.' : 'Esta bóveda todavía no tiene contraseñas guardadas.')
|
|
2810
|
+
return
|
|
2811
|
+
}
|
|
2812
|
+
if (!r.found.length) {
|
|
2813
|
+
console.log('\nNo hay nada guardado para %s%s%s (%d entrada(s) en total).\n', B, query, Z, r.entries)
|
|
2814
|
+
console.log('Se busca por el dominio y sus padres: login.ejemplo.com encuentra lo guardado para ejemplo.com.\n')
|
|
2815
|
+
return
|
|
2816
|
+
}
|
|
2817
|
+
const name = (d) => d ? `${d.id}${d.label ? ' ' + d.label : ''}` : '?'
|
|
2818
|
+
const when = (ms) => ms ? new Date(ms).toLocaleString() : '?'
|
|
2819
|
+
console.log('\n%d resultado(s) para %s%s%s\n', r.found.length, B, query, Z)
|
|
2820
|
+
for (const f of r.found) {
|
|
2821
|
+
const kind = f.passkey ? (f.view?.hasSecret ? 'contraseña + passkey' : 'passkey') : 'contraseña'
|
|
2822
|
+
const title = f.view ? (f.view.title || '(sin título)') : '(no se puede abrir con la frase)'
|
|
2823
|
+
console.log(' %s%s%s · %s', B, title, Z, kind)
|
|
2824
|
+
if (f.view?.user) console.log(' usuario: %s', f.view.user)
|
|
2825
|
+
if (f.view?.sites?.length) console.log(' sitios: %s', f.view.sites.join(', '))
|
|
2826
|
+
if (f.view?.rpId) console.log(' passkey de: %s', f.view.rpId)
|
|
2827
|
+
console.log(' guardada: %s, por %s', when(f.updatedAt), name(f.by))
|
|
2828
|
+
console.log(' la abren: %s', f.holders.length ? f.holders.map(name).join(', ') : 'ningún aparato')
|
|
2829
|
+
if (f.missing.length) console.log(' %sFALTA en:%s %s ← se le reparte al abrir la bóveda: dotrino-vault lock && dotrino-vault unlock', R, Z, f.missing.map(name).join(', '))
|
|
2830
|
+
else console.log(' sincronizada: sí, la abren todos los aparatos con permiso de contraseñas')
|
|
2831
|
+
if (!f.recovery) console.log(' %s¡OJO!%s la frase del perfil no la abre: no entra en el respaldo', R, Z)
|
|
2832
|
+
if (f.broken) console.log(' %s¡OJO!%s le falta una llave en el llavero: está dañada', R, Z)
|
|
2833
|
+
console.log('')
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2788
2837
|
/** «hace 3 días», «hace 5 horas»: para decir desde cuándo espera algo. */
|
|
2789
2838
|
function ago (ms) {
|
|
2790
2839
|
const h = Math.max(0, Math.floor((Date.now() - ms) / 3600000))
|
|
@@ -2829,6 +2878,7 @@ export async function runCtl (argv) {
|
|
|
2829
2878
|
case 'update': return cmdUpdate(rest)
|
|
2830
2879
|
case 'secret': return cmdSecret(rest)
|
|
2831
2880
|
case 'backup': return cmdBackup(rest)
|
|
2881
|
+
case 'passwords': return cmdPasswords(rest)
|
|
2832
2882
|
// `approval` se quitó el 2026-09-01 (ahora es el permiso `unattended`), pero la ruta se
|
|
2833
2883
|
// quedó apuntando a una función que ya no existía: reventaba con un ReferenceError. Se
|
|
2834
2884
|
// rechaza en voz alta, igual que `caps +approval`.
|
package/src/daemon.js
CHANGED
|
@@ -812,7 +812,11 @@ export async function runDaemon () {
|
|
|
812
812
|
// EL RESPALDO. Bóveda abierta (lo comprueba la bóveda) y la contraseña del RESPALDO,
|
|
813
813
|
// que no es la del perfil: con ella se cierra el archivo aquí mismo, para que lo que
|
|
814
814
|
// salga de este proceso ya vaya cifrado.
|
|
815
|
-
|
|
815
|
+
// BUSCAR UNA CONTRASEÑA POR SITIO. Solo lee: dice si está y quién la abre. Va por el
|
|
816
|
+
// canal del respaldo porque pide lo mismo (bóveda abierta) y contesta igual.
|
|
817
|
+
else if (sec.op === 'passwords-find') {
|
|
818
|
+
lastBackup = { op: sec.op, id: sec.id || null, result: await vault.findPasswords(sec.query, { adminKey: ak }) }
|
|
819
|
+
} else if (sec.op === 'backup-drawers') {
|
|
816
820
|
lastBackup = { op: sec.op, id: sec.id || null, drawers: await vault.backupDrawers() }
|
|
817
821
|
} else if (sec.op === 'backup-export') {
|
|
818
822
|
const { payload, summary } = await vault.exportBackup({ drawers: sec.drawers || null, adminKey: ak })
|
|
@@ -849,7 +853,7 @@ export async function runDaemon () {
|
|
|
849
853
|
// Los choques de una importación viajan con el error: son lo que hay que decidir.
|
|
850
854
|
...(e.conflicts ? { conflicts: e.conflicts } : {}),
|
|
851
855
|
...(e.missing ? { missing: e.missing } : {}),
|
|
852
|
-
...(sec.op?.startsWith('backup-') ? { op: sec.op, id: sec.id || null } : {})
|
|
856
|
+
...((sec.op?.startsWith('backup-') || sec.op === 'passwords-find') ? { op: sec.op, id: sec.id || null } : {})
|
|
853
857
|
}
|
|
854
858
|
console.error('[vault] secret failed:', e.message)
|
|
855
859
|
} finally { wipe(ak) }
|
package/src/tui/app.js
CHANGED
|
@@ -1406,6 +1406,15 @@ async function onKeyProfiles (term, st, key) {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
await openBackup(term, st)
|
|
1408
1408
|
})
|
|
1409
|
+
} else if (ch === 'f' && cur) { // buscar una contraseña por sitio, con la bóveda abierta
|
|
1410
|
+
await ensureUnlocked(term, st, cur, async (p = cur) => {
|
|
1411
|
+
if (!p.current) {
|
|
1412
|
+
const r = await guard(term, st, i.switchingVault, () => vc.useProfile(p.id))
|
|
1413
|
+
if (!r.ok) return
|
|
1414
|
+
await refreshAll(term, st)
|
|
1415
|
+
}
|
|
1416
|
+
askPwFind(term, st)
|
|
1417
|
+
})
|
|
1409
1418
|
} else if (ch === 'y' && cur) { // las llaves: con qué se abre la bóveda
|
|
1410
1419
|
await ensureUnlocked(term, st, cur, async (p = cur) => {
|
|
1411
1420
|
st.doorsFor = p.id
|
|
@@ -2588,6 +2597,81 @@ function backupPlanRows (st, t) {
|
|
|
2588
2597
|
return rows
|
|
2589
2598
|
}
|
|
2590
2599
|
|
|
2600
|
+
/**
|
|
2601
|
+
* BUSCAR UNA CONTRASEÑA O PASSKEY POR SITIO (`dotrino-vault passwords find`). Solo lee: dice
|
|
2602
|
+
* si está, con qué usuario y qué aparatos la abren; ni enseña el valor ni cambia nada.
|
|
2603
|
+
*/
|
|
2604
|
+
function askPwFind (term, st) {
|
|
2605
|
+
const i = L(st)
|
|
2606
|
+
setInput(st, {
|
|
2607
|
+
label: i.pwFindLabel,
|
|
2608
|
+
hint: i.pwFindHint,
|
|
2609
|
+
onSubmit: async (q) => {
|
|
2610
|
+
st.input = null
|
|
2611
|
+
const query = (q || '').trim()
|
|
2612
|
+
if (!query) return
|
|
2613
|
+
st.busy = i.pwFinding
|
|
2614
|
+
render(term, st)
|
|
2615
|
+
try {
|
|
2616
|
+
const result = await vc.passwordsFind(query, activeId(st))
|
|
2617
|
+
st.busy = null
|
|
2618
|
+
st.pwFind = { query, result }
|
|
2619
|
+
st.sel.pwfind = 0
|
|
2620
|
+
st.scroll.pwfind = { value: 0 }
|
|
2621
|
+
st.screen = 'pwfind'
|
|
2622
|
+
} catch (e) {
|
|
2623
|
+
st.busy = null
|
|
2624
|
+
const msg = e?.code === 'BAD_SITE' ? i.pwFindBadSite : e?.code === 'NO_RECOVERY' ? i.pwFindNoRecovery : backupErr(e, st)
|
|
2625
|
+
flash(st, msg, 'danger')
|
|
2626
|
+
}
|
|
2627
|
+
},
|
|
2628
|
+
onCancel: () => { st.input = null }
|
|
2629
|
+
})
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
function pwFindRows (st, t) {
|
|
2633
|
+
const i = L(st)
|
|
2634
|
+
const f = st.pwFind
|
|
2635
|
+
if (!f) return []
|
|
2636
|
+
const r = f.result
|
|
2637
|
+
const rows = [{ text: ' ' + t.bold(i.pwFindFor(f.query)), sel: false }, { text: '', sel: false }]
|
|
2638
|
+
if (!r.sealed) { rows.push({ text: ' ' + t.muted(r.entries ? i.pwFindOld : i.pwFindEmpty), sel: false }); return rows }
|
|
2639
|
+
if (!r.found.length) {
|
|
2640
|
+
rows.push({ text: ' ' + i.pwFindNone(f.query, r.entries), sel: false })
|
|
2641
|
+
rows.push({ text: ' ' + t.muted(i.pwFindParents), sel: false })
|
|
2642
|
+
return rows
|
|
2643
|
+
}
|
|
2644
|
+
const name = (d) => d ? `${d.id}${d.label ? ' ' + d.label : ''}` : '?'
|
|
2645
|
+
const when = (ms) => ms ? new Date(ms).toLocaleString(i.code) : '?'
|
|
2646
|
+
for (const e of r.found) {
|
|
2647
|
+
const kind = e.passkey ? (e.view?.hasSecret ? i.pwKindBoth : i.pwKindPasskey) : i.pwKindPassword
|
|
2648
|
+
const title = e.view ? (e.view.title || i.pwNoTitle) : i.pwNotOpenable
|
|
2649
|
+
rows.push({ text: ` ${t.bold(title)} ${t.muted('· ' + kind)}`, sel: true })
|
|
2650
|
+
if (e.view?.user) rows.push({ text: ` ${t.muted(i.pwUser + ':')} ${e.view.user}`, sel: false })
|
|
2651
|
+
if (e.view?.sites?.length) rows.push({ text: ` ${t.muted(i.pwSites + ':')} ${e.view.sites.join(', ')}`, sel: false })
|
|
2652
|
+
if (e.view?.rpId) rows.push({ text: ` ${t.muted(i.pwPasskeyOf + ':')} ${e.view.rpId}`, sel: false })
|
|
2653
|
+
rows.push({ text: ' ' + t.muted(i.pwSaved(when(e.updatedAt), name(e.by))), sel: false })
|
|
2654
|
+
rows.push({ text: ` ${t.muted(i.pwHolders + ':')} ${e.holders.length ? e.holders.map(name).join(', ') : i.pwNobody}`, sel: false })
|
|
2655
|
+
if (e.missing.length) rows.push({ text: ` ${t.danger(i.pwMissing + ':')} ${e.missing.map(name).join(', ')} ${t.muted('← ' + i.pwMissingFix)}`, sel: false })
|
|
2656
|
+
else rows.push({ text: ' ' + t.accent('✓ ' + i.pwSynced), sel: false })
|
|
2657
|
+
if (!e.recovery) rows.push({ text: ' ' + t.warn('! ' + i.pwNoRecovery), sel: false })
|
|
2658
|
+
if (e.broken) rows.push({ text: ' ' + t.danger('! ' + i.pwBroken), sel: false })
|
|
2659
|
+
rows.push({ text: '', sel: false })
|
|
2660
|
+
}
|
|
2661
|
+
return rows
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
async function onKeyPwFind (term, st, key) {
|
|
2665
|
+
const ch = key.name === 'char' ? key.ch.toLowerCase() : null
|
|
2666
|
+
if (key.name === 'escape' || ch === 'b' || !st.pwFind) { st.screen = 'profiles'; st.pwFind = null; return true }
|
|
2667
|
+
if (['up', 'down', 'pageup', 'pagedown', 'home', 'end'].includes(key.name)) {
|
|
2668
|
+
moveSel(st, key, 'pwfind', pwFindRows(st, makeTheme()).filter((r) => r.sel).length)
|
|
2669
|
+
return true
|
|
2670
|
+
}
|
|
2671
|
+
if (ch === 'f') { askPwFind(term, st); return true }
|
|
2672
|
+
return true
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2591
2675
|
/** Abre la pantalla de respaldo de la bóveda activa: carga qué cajones hay. */
|
|
2592
2676
|
async function openBackup (term, st) {
|
|
2593
2677
|
const i = L(st)
|
|
@@ -2814,7 +2898,8 @@ const helpSegs = (i, screen, st = {}) => {
|
|
|
2814
2898
|
caps: i.helpCaps,
|
|
2815
2899
|
devvars: i.helpDevVars,
|
|
2816
2900
|
backup: i.helpBackup,
|
|
2817
|
-
backupplan: i.helpBackupPlan
|
|
2901
|
+
backupplan: i.helpBackupPlan,
|
|
2902
|
+
pwfind: i.helpPwFind
|
|
2818
2903
|
}[screen] || []
|
|
2819
2904
|
if (typeof segs !== 'function') return segs
|
|
2820
2905
|
// El aparato señalado ahora mismo: `e variables` solo tiene sentido en un servicio (es
|
|
@@ -2851,7 +2936,8 @@ const title = (i, screen) => ({
|
|
|
2851
2936
|
caps: i.titleCaps,
|
|
2852
2937
|
devvars: i.titleDevVars,
|
|
2853
2938
|
backup: i.titleBackup,
|
|
2854
|
-
backupplan: i.titleBackupPlan
|
|
2939
|
+
backupplan: i.titleBackupPlan,
|
|
2940
|
+
pwfind: i.titlePwFind
|
|
2855
2941
|
})[screen] || ''
|
|
2856
2942
|
|
|
2857
2943
|
/** Barra de pestañas horizontal (Dispositivos | Scopes y variables) de la bóveda entrada. */
|
|
@@ -2993,6 +3079,7 @@ function render (term, st) {
|
|
|
2993
3079
|
else if (st.screen === 'paircaps') body = renderList(pairCapsRows(st, t), st.sel.paircaps || 0, contentH, cols, t, scrollRef)
|
|
2994
3080
|
else if (st.screen === 'backup') body = renderList(backupRows(st, t), st.sel.backup || 0, contentH, cols, t, scrollRef)
|
|
2995
3081
|
else if (st.screen === 'backupplan') body = renderList(backupPlanRows(st, t), st.sel.backupplan || 0, contentH, cols, t, scrollRef)
|
|
3082
|
+
else if (st.screen === 'pwfind') body = renderList(pwFindRows(st, t), st.sel.pwfind || 0, contentH, cols, t, scrollRef)
|
|
2996
3083
|
else if (st.screen === 'pairing') {
|
|
2997
3084
|
const pb = pairingBody(st, t, cols, contentH)
|
|
2998
3085
|
body = scrollBody(pb, contentH, scrollRef)
|
|
@@ -3037,7 +3124,8 @@ const LIST_SCREENS = {
|
|
|
3037
3124
|
settings: [settingsRows, 'settings'],
|
|
3038
3125
|
paircaps: [pairCapsRows, 'paircaps'],
|
|
3039
3126
|
backup: [backupRows, 'backup'],
|
|
3040
|
-
backupplan: [backupPlanRows, 'backupplan']
|
|
3127
|
+
backupplan: [backupPlanRows, 'backupplan'],
|
|
3128
|
+
pwfind: [pwFindRows, 'pwfind']
|
|
3041
3129
|
}
|
|
3042
3130
|
|
|
3043
3131
|
/**
|
|
@@ -3327,6 +3415,7 @@ export async function handleKey (term, st, key) {
|
|
|
3327
3415
|
if (st.screen === 'paircaps') return onKeyPairCaps(term, st, key)
|
|
3328
3416
|
if (st.screen === 'backup') return onKeyBackup(term, st, key)
|
|
3329
3417
|
if (st.screen === 'backupplan') return onKeyBackupPlan(term, st, key)
|
|
3418
|
+
if (st.screen === 'pwfind') return onKeyPwFind(term, st, key)
|
|
3330
3419
|
if (st.screen === 'pairing') return onKeyPairing(term, st, key)
|
|
3331
3420
|
if (st.screen === 'join') return onKeyJoin(term, st, key)
|
|
3332
3421
|
return true
|
|
@@ -3389,4 +3478,4 @@ export async function runTui () {
|
|
|
3389
3478
|
}
|
|
3390
3479
|
|
|
3391
3480
|
// Solo para pruebas headless (render sin terminal real). No usar en runtime.
|
|
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 } }
|
|
3481
|
+
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, pwFindRows, onKeyPwFind, resetToque: () => { lastTouch = 0 } }
|
package/src/tui/i18n.js
CHANGED
|
@@ -402,6 +402,35 @@ const es = {
|
|
|
402
402
|
// variables de UN aparato (Dispositivos → tecla e). Las del scope las comparten todos
|
|
403
403
|
// los aparatos que sirven ese namespace; estas las lee solo él, y le ganan.
|
|
404
404
|
titleDevVars: 'Variables del dispositivo',
|
|
405
|
+
// BUSCAR UNA CONTRASEÑA POR SITIO (Bóvedas → tecla f). Solo lee.
|
|
406
|
+
titlePwFind: 'Buscar contraseña',
|
|
407
|
+
helpPwFind: ['↑↓', 'f otra búsqueda', 'Esc atrás', 'l English', 'q salir'],
|
|
408
|
+
pwFindLabel: 'Sitio a buscar',
|
|
409
|
+
pwFindHint: 'un dominio (ejemplo.com) o una URL',
|
|
410
|
+
pwFinding: 'buscando…',
|
|
411
|
+
pwFindFor: (q) => `Lo guardado para ${q}`,
|
|
412
|
+
pwFindNone: (q, n) => `No hay nada guardado para ${q} (${n} entrada(s) en total).`,
|
|
413
|
+
pwFindParents: 'Se busca por el dominio y sus padres: login.ejemplo.com encuentra lo de ejemplo.com.',
|
|
414
|
+
pwFindEmpty: 'Esta bóveda todavía no tiene contraseñas guardadas.',
|
|
415
|
+
pwFindOld: 'Las contraseñas están en el formato viejo: abre la bóveda para convertirlas.',
|
|
416
|
+
pwFindBadSite: 'Eso no es un sitio: escribe un dominio (ejemplo.com) o una URL.',
|
|
417
|
+
pwFindNoRecovery: 'La llave de las contraseñas aún no tiene la copia de la frase: abre la bóveda para que la reciba.',
|
|
418
|
+
pwKindPassword: 'contraseña',
|
|
419
|
+
pwKindPasskey: 'passkey',
|
|
420
|
+
pwKindBoth: 'contraseña + passkey',
|
|
421
|
+
pwNoTitle: '(sin título)',
|
|
422
|
+
pwNotOpenable: '(la frase no la abre)',
|
|
423
|
+
pwUser: 'usuario',
|
|
424
|
+
pwSites: 'sitios',
|
|
425
|
+
pwPasskeyOf: 'passkey de',
|
|
426
|
+
pwSaved: (when, by) => `guardada ${when}, por ${by}`,
|
|
427
|
+
pwHolders: 'la abren',
|
|
428
|
+
pwNobody: 'ningún aparato',
|
|
429
|
+
pwMissing: 'FALTA en',
|
|
430
|
+
pwMissingFix: 'se le reparte al abrir la bóveda: ciérrala (k) y vuelve a abrirla (u)',
|
|
431
|
+
pwSynced: 'sincronizada: la abren todos los aparatos con permiso de contraseñas',
|
|
432
|
+
pwNoRecovery: 'la frase del perfil no la abre: no entra en el respaldo',
|
|
433
|
+
pwBroken: 'le falta una llave en el llavero: está dañada',
|
|
405
434
|
// EL RESPALDO (`docs/respaldo.md`).
|
|
406
435
|
titleBackup: 'Respaldo',
|
|
407
436
|
titleBackupPlan: 'Importar un respaldo',
|
|
@@ -520,7 +549,7 @@ const es = {
|
|
|
520
549
|
// INGLÉS: new/rename/delete/password/unlock/locK/pair/approve/revoke/refresh/
|
|
521
550
|
// language/quit); lo único que se traduce es la palabra que las explica.
|
|
522
551
|
// Segmentos, no una línea: si no caben en una, el render los reparte en varias.
|
|
523
|
-
helpProfiles: ['↑↓', 'Enter entrar', 'p emparejar', 'j unirse', 'n nueva', 'r renombrar', 'd borrar', 'c clave', 'x quitar-clave', 'y llaves', 'o respaldo', 'u desbloq', 'k bloquear', 's ajustes', 'l English', 'q salir'],
|
|
552
|
+
helpProfiles: ['↑↓', 'Enter entrar', 'p emparejar', 'j unirse', 'n nueva', 'r renombrar', 'd borrar', 'c clave', 'x quitar-clave', 'y llaves', 'o respaldo', 'f buscar clave', 'u desbloq', 'k bloquear', 's ajustes', 'l English', 'q salir'],
|
|
524
553
|
// La barra dice lo que se PUEDE hacer AHORA, no todo lo que existe: aprobar/rechazar solo
|
|
525
554
|
// valen si hay alguien esperando, y renombrar/revocar solo si hay un aparato seleccionado.
|
|
526
555
|
// Anunciar teclas muertas confunde y además las quema para otros usos.
|
|
@@ -943,6 +972,35 @@ const en = {
|
|
|
943
972
|
|
|
944
973
|
// variables de UN aparato (Dispositivos → tecla e)
|
|
945
974
|
titleDevVars: 'Device variables',
|
|
975
|
+
// FIND A PASSWORD BY SITE (Vaults → key f). Read-only.
|
|
976
|
+
titlePwFind: 'Find a password',
|
|
977
|
+
helpPwFind: ['↑↓', 'f search again', 'Esc back', 'l Español', 'q quit'],
|
|
978
|
+
pwFindLabel: 'Site to look for',
|
|
979
|
+
pwFindHint: 'a domain (example.com) or a URL',
|
|
980
|
+
pwFinding: 'searching…',
|
|
981
|
+
pwFindFor: (q) => `Saved for ${q}`,
|
|
982
|
+
pwFindNone: (q, n) => `Nothing saved for ${q} (${n} entr${n === 1 ? 'y' : 'ies'} in total).`,
|
|
983
|
+
pwFindParents: 'The domain and its parents are searched: login.example.com finds what is saved for example.com.',
|
|
984
|
+
pwFindEmpty: 'This vault has no saved passwords yet.',
|
|
985
|
+
pwFindOld: 'The passwords are in the old format: open the vault to convert them.',
|
|
986
|
+
pwFindBadSite: 'That is not a site: type a domain (example.com) or a URL.',
|
|
987
|
+
pwFindNoRecovery: 'The password key has no copy for the phrase yet: open the vault so it gets one.',
|
|
988
|
+
pwKindPassword: 'password',
|
|
989
|
+
pwKindPasskey: 'passkey',
|
|
990
|
+
pwKindBoth: 'password + passkey',
|
|
991
|
+
pwNoTitle: '(no title)',
|
|
992
|
+
pwNotOpenable: '(the phrase does not open it)',
|
|
993
|
+
pwUser: 'user',
|
|
994
|
+
pwSites: 'sites',
|
|
995
|
+
pwPasskeyOf: 'passkey for',
|
|
996
|
+
pwSaved: (when, by) => `saved ${when}, by ${by}`,
|
|
997
|
+
pwHolders: 'opened by',
|
|
998
|
+
pwNobody: 'no device',
|
|
999
|
+
pwMissing: 'MISSING on',
|
|
1000
|
+
pwMissingFix: 'it is handed over when the vault opens: lock it (k) and open it again (u)',
|
|
1001
|
+
pwSynced: 'synced: every device allowed to use passwords can open it',
|
|
1002
|
+
pwNoRecovery: 'the profile phrase does not open it: it is left out of backups',
|
|
1003
|
+
pwBroken: 'a key is missing from the keyring: it is damaged',
|
|
946
1004
|
titleBackup: 'Backup',
|
|
947
1005
|
titleBackupPlan: 'Import a backup',
|
|
948
1006
|
helpBackup: ['↑↓', 'Enter mark', 'g export', 'i import', 'Esc back', 'l Español', 'q quit'],
|
|
@@ -1051,7 +1109,7 @@ const en = {
|
|
|
1051
1109
|
helpInput: 'Enter confirm · Esc cancel · Ctrl-U clear',
|
|
1052
1110
|
helpConfirm: 'y confirm · n/Esc cancel',
|
|
1053
1111
|
|
|
1054
|
-
helpProfiles: ['↑↓', 'Enter open', 'p pair', 'j join', 'n new', 'r rename', 'd delete', 'c password', 'x drop-password', 'y keys', 'o backup', 'u unlock', 'k lock', 's settings', 'l Español', 'q quit'],
|
|
1112
|
+
helpProfiles: ['↑↓', 'Enter open', 'p pair', 'j join', 'n new', 'r rename', 'd delete', 'c password', 'x drop-password', 'y keys', 'o backup', 'f find password', 'u unlock', 'k lock', 's settings', 'l Español', 'q quit'],
|
|
1055
1113
|
helpDevices: ({ pending, hasDevices, isService, drafts, curBlocked } = {}) => [
|
|
1056
1114
|
'←→ tab', '↑↓', 'p pair',
|
|
1057
1115
|
...(drafts ? ['g save permissions'] : []),
|
package/src/vaultControl.js
CHANGED
|
@@ -677,6 +677,14 @@ export async function backupImport (file, backupPassword, { drawers = null, map
|
|
|
677
677
|
return (await backupOp({ op: 'backup-import', file, backupPassword, drawers, map, onConflict, decisions }, profile)).result
|
|
678
678
|
}
|
|
679
679
|
|
|
680
|
+
/**
|
|
681
|
+
* ¿Hay contraseña o passkey para ese sitio y la abren todos los aparatos que deberían?
|
|
682
|
+
* Solo lee. `{ sealed, entries, found: [{ title, user, passkey, holders, missing, … }] }`.
|
|
683
|
+
*/
|
|
684
|
+
export async function passwordsFind (query, profile) {
|
|
685
|
+
return (await backupOp({ op: 'passwords-find', query }, profile)).result
|
|
686
|
+
}
|
|
687
|
+
|
|
680
688
|
/** SALDA lo que quedó a deber (heredar lo viejo, rotar de verdad). Pide la contraseña. */
|
|
681
689
|
export function settleSecrets (profile, password) {
|
|
682
690
|
return secretOp({ op: 'settle', ...(password ? { password } : {}) }, profile, () => {})
|