@wipcomputer/wip-ldm-os 0.4.85-alpha.16 → 0.4.85-alpha.17
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/package.json
CHANGED
|
@@ -69,6 +69,24 @@ assert(registry.auditLog[1].replaced === true, "audit marks replacement");
|
|
|
69
69
|
assert(registry.auditLog[1].old_pubkey_fingerprint === oldFingerprint, "audit stores old fingerprint");
|
|
70
70
|
assert(registry.auditLog[1].new_pubkey_fingerprint === newFingerprint, "audit stores new fingerprint");
|
|
71
71
|
|
|
72
|
+
const executeCalls = [];
|
|
73
|
+
const persistedRegistry = createCodexDaemonPubkeyRegistry({
|
|
74
|
+
usePrisma: true,
|
|
75
|
+
devMode: false,
|
|
76
|
+
logger: createSilentLogger(),
|
|
77
|
+
prisma: {
|
|
78
|
+
async $executeRawUnsafe(sql, ...args) {
|
|
79
|
+
executeCalls.push({ sql, args });
|
|
80
|
+
return 1;
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
await persistedRegistry.register("acct:test-user-b", "persisted-spki-key", ["e2ee-v1"], "daemon-reconnect");
|
|
85
|
+
const auditInsert = executeCalls.find((call) => call.sql.includes("INSERT INTO codex_daemon_e2ee_key_audit"));
|
|
86
|
+
assert(auditInsert, "audit insert executes for persisted registry");
|
|
87
|
+
assert(auditInsert.sql.includes("$7::timestamptz"), "audit insert casts registered_at parameter to timestamptz");
|
|
88
|
+
assert(typeof auditInsert.args[6] === "string" && auditInsert.args[6].includes("T"), "audit insert passes ISO registered_at value");
|
|
89
|
+
|
|
72
90
|
function pairCompleteModel({ hasDaemonPublicKey, pairPresenceOk, previousPubkey, nextPubkey }) {
|
|
73
91
|
if (hasDaemonPublicKey && !pairPresenceOk) return { code: 403, error: "fresh_presence_required" };
|
|
74
92
|
const replaced = !!(previousPubkey && nextPubkey && previousPubkey !== nextPubkey);
|
|
@@ -120,7 +120,7 @@ export function createCodexDaemonPubkeyRegistry({
|
|
|
120
120
|
await prisma.$executeRawUnsafe(
|
|
121
121
|
`INSERT INTO codex_daemon_e2ee_key_audit
|
|
122
122
|
(id, tenant_id, source, old_pubkey_fingerprint, new_pubkey_fingerprint, replaced, registered_at)
|
|
123
|
-
VALUES ($1, $2, $3, $4, $5, $6, $7)`,
|
|
123
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7::timestamptz)`,
|
|
124
124
|
randomUUID(),
|
|
125
125
|
agentId,
|
|
126
126
|
source,
|