openfused 0.3.17 → 0.3.19
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/dist/cli.js +6 -7
- package/dist/store.js +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -635,12 +635,11 @@ program
|
|
|
635
635
|
const reg = registry.resolveRegistry(opts.registry);
|
|
636
636
|
try {
|
|
637
637
|
const manifest = await registry.discover(name, reg);
|
|
638
|
-
// Auto-import key
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
//
|
|
642
|
-
|
|
643
|
-
// service. Sync will pull from it — consider validating URL scheme/host.
|
|
638
|
+
// Auto-import key + add as peer. Keys discovered from openfused.net DNS
|
|
639
|
+
// are auto-trusted: the registry verified the Ed25519 signature before
|
|
640
|
+
// creating the TXT record, and DNSSEC is enabled on the zone. Keys from
|
|
641
|
+
// self-hosted domains remain untrusted (user must verify out-of-band).
|
|
642
|
+
const dnsDiscovered = !name.includes(".") || name.endsWith(".openfused.net");
|
|
644
643
|
let config = await store.readConfig();
|
|
645
644
|
if (!config.keyring.some((e) => e.signingKey === manifest.publicKey)) {
|
|
646
645
|
config.keyring.push({
|
|
@@ -649,7 +648,7 @@ program
|
|
|
649
648
|
signingKey: manifest.publicKey,
|
|
650
649
|
encryptionKey: manifest.encryptionKey,
|
|
651
650
|
fingerprint: manifest.fingerprint,
|
|
652
|
-
trusted:
|
|
651
|
+
trusted: dnsDiscovered,
|
|
653
652
|
added: new Date().toISOString(),
|
|
654
653
|
});
|
|
655
654
|
}
|
package/dist/store.js
CHANGED
|
@@ -193,10 +193,10 @@ export class ContextStore {
|
|
|
193
193
|
signed = await signMessage(this.root, config.name, message);
|
|
194
194
|
}
|
|
195
195
|
// Envelope filename includes short fingerprint to disambiguate name collisions.
|
|
196
|
-
//
|
|
197
|
-
const shortFp = entry ? entry.fingerprint.replace(/:/g, "").slice(0, 8) : "
|
|
196
|
+
// If recipient isn't in keyring, omit fingerprint — keeps filenames matchable.
|
|
197
|
+
const shortFp = entry ? `-${entry.fingerprint.replace(/:/g, "").slice(0, 8)}` : "";
|
|
198
198
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
199
|
-
const filename = `${timestamp}_from-${config.name}_to-${peerId}
|
|
199
|
+
const filename = `${timestamp}_from-${config.name}_to-${peerId}${shortFp}.json`;
|
|
200
200
|
await writeFile(join(this.root, "outbox", filename), serializeSignedMessage(signed));
|
|
201
201
|
return filename;
|
|
202
202
|
}
|