@dotrino/vaultd 0.193.1 → 0.193.2
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.
|
@@ -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.2",
|
|
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": {
|