@sempdev/semp 0.5.2 → 0.5.6
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/brief/address.d.ts +1 -1
- package/dist/brief/address.js +1 -1
- package/dist/brief/brief.d.ts +1 -1
- package/dist/brief/brief.js +1 -1
- package/dist/canonical/marshal.d.ts +2 -2
- package/dist/canonical/marshal.js +2 -2
- package/dist/closure/driver.d.ts +2 -2
- package/dist/closure/driver.js +1 -1
- package/dist/crypto/aead.d.ts +2 -2
- package/dist/crypto/aead.js +2 -2
- package/dist/crypto/kdf.d.ts +1 -1
- package/dist/crypto/kdf.js +1 -1
- package/dist/crypto/mac.d.ts +1 -1
- package/dist/crypto/mac.js +1 -1
- package/dist/delivery/ack.d.ts +5 -5
- package/dist/delivery/ack.js +6 -6
- package/dist/delivery/blocklist.d.ts +1 -1
- package/dist/delivery/blocklist.js +2 -2
- package/dist/delivery/device_sync.d.ts +26 -0
- package/dist/delivery/device_sync.d.ts.map +1 -0
- package/dist/delivery/device_sync.js +18 -0
- package/dist/delivery/device_sync.js.map +1 -0
- package/dist/delivery/disposition.d.ts +1 -1
- package/dist/delivery/fetch.d.ts +1 -1
- package/dist/delivery/fetch.js +1 -1
- package/dist/delivery/forwarder.d.ts +9 -1
- package/dist/delivery/forwarder.d.ts.map +1 -1
- package/dist/delivery/forwarder.js +1 -1
- package/dist/delivery/forwarder.js.map +1 -1
- package/dist/delivery/inbox.d.ts +2 -2
- package/dist/delivery/inbox.js +2 -2
- package/dist/delivery/index.d.ts +4 -0
- package/dist/delivery/index.d.ts.map +1 -1
- package/dist/delivery/index.js +4 -0
- package/dist/delivery/index.js.map +1 -1
- package/dist/delivery/persistent_silent.d.ts +70 -0
- package/dist/delivery/persistent_silent.d.ts.map +1 -0
- package/dist/delivery/persistent_silent.js +117 -0
- package/dist/delivery/persistent_silent.js.map +1 -0
- package/dist/delivery/pipeline.d.ts +4 -4
- package/dist/delivery/pipeline.d.ts.map +1 -1
- package/dist/delivery/pipeline.js +10 -3
- package/dist/delivery/pipeline.js.map +1 -1
- package/dist/delivery/policy_state.d.ts +2 -2
- package/dist/delivery/policy_state.js +4 -4
- package/dist/delivery/receipt.d.ts +3 -3
- package/dist/delivery/receipt.js +3 -3
- package/dist/delivery/receipt_store.d.ts +1 -1
- package/dist/delivery/receipt_store.js +1 -1
- package/dist/delivery/retry.d.ts +2 -2
- package/dist/delivery/retry.js +2 -2
- package/dist/delivery/scheduler.d.ts +1 -1
- package/dist/delivery/scheduler.js +1 -1
- package/dist/delivery/stage_partition.d.ts +1 -1
- package/dist/delivery/stage_partition.js +1 -1
- package/dist/delivery/staged_runner.d.ts +1 -1
- package/dist/delivery/staged_runner.js +2 -2
- package/dist/delivery/status_message.d.ts +75 -0
- package/dist/delivery/status_message.d.ts.map +1 -0
- package/dist/delivery/status_message.js +109 -0
- package/dist/delivery/status_message.js.map +1 -0
- package/dist/delivery/upgrade_signal.d.ts +48 -0
- package/dist/delivery/upgrade_signal.d.ts.map +1 -0
- package/dist/delivery/upgrade_signal.js +48 -0
- package/dist/delivery/upgrade_signal.js.map +1 -0
- package/dist/discovery/configuration.d.ts +20 -1
- package/dist/discovery/configuration.d.ts.map +1 -1
- package/dist/discovery/configuration.js.map +1 -1
- package/dist/discovery/dns.d.ts +27 -1
- package/dist/discovery/dns.d.ts.map +1 -1
- package/dist/discovery/dns.js +37 -0
- package/dist/discovery/dns.js.map +1 -1
- package/dist/discovery/index.d.ts +2 -2
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +1 -1
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/partition.d.ts +1 -1
- package/dist/discovery/partition.js +1 -1
- package/dist/discovery/resolver.d.ts +5 -5
- package/dist/discovery/resolver.js +5 -5
- package/dist/discovery/txt.d.ts +1 -1
- package/dist/discovery/txt.js +1 -1
- package/dist/enclosure/forwarding.d.ts +1 -1
- package/dist/enclosure/forwarding.js +1 -1
- package/dist/envelope/buckets.d.ts +2 -2
- package/dist/envelope/buckets.js +2 -2
- package/dist/envelope/compose.d.ts +2 -2
- package/dist/envelope/compose.js +4 -4
- package/dist/envelope/encode.d.ts +2 -2
- package/dist/envelope/encode.js +3 -3
- package/dist/envelope/open_verified.d.ts +1 -1
- package/dist/envelope/open_verified.js +1 -1
- package/dist/envelope/padding.d.ts +2 -2
- package/dist/envelope/padding.js +3 -3
- package/dist/envelope/verify.d.ts +1 -1
- package/dist/envelope/verify.js +1 -1
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +1 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/limits.d.ts +2 -2
- package/dist/extensions/limits.js +2 -2
- package/dist/extensions/validation_failure.d.ts +48 -0
- package/dist/extensions/validation_failure.d.ts.map +1 -0
- package/dist/extensions/validation_failure.js +25 -0
- package/dist/extensions/validation_failure.js.map +1 -0
- package/dist/handshake/abort.d.ts +1 -1
- package/dist/handshake/abort.js +1 -1
- package/dist/handshake/client_state.d.ts +5 -5
- package/dist/handshake/client_state.js +5 -5
- package/dist/handshake/confirm.d.ts +2 -2
- package/dist/handshake/confirm.js +2 -2
- package/dist/handshake/driver.d.ts +2 -2
- package/dist/handshake/driver.js +1 -1
- package/dist/handshake/federation.d.ts +27 -9
- package/dist/handshake/federation.d.ts.map +1 -1
- package/dist/handshake/federation.js +69 -17
- package/dist/handshake/federation.js.map +1 -1
- package/dist/handshake/first_contact.d.ts +1 -1
- package/dist/handshake/first_contact.js +1 -1
- package/dist/handshake/identity.d.ts +1 -1
- package/dist/handshake/identity.js +1 -1
- package/dist/handshake/index.d.ts +1 -1
- package/dist/handshake/index.d.ts.map +1 -1
- package/dist/handshake/index.js.map +1 -1
- package/dist/handshake/pow.js +1 -1
- package/dist/handshake/server_state.d.ts +3 -3
- package/dist/handshake/server_state.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/keys/compromise.d.ts +2 -2
- package/dist/keys/compromise.js +1 -1
- package/dist/keys/device_certificate.d.ts +3 -3
- package/dist/keys/device_certificate.js +4 -4
- package/dist/keys/key_revocation.d.ts +2 -2
- package/dist/keys/key_revocation.js +1 -1
- package/dist/keys/request.d.ts +17 -3
- package/dist/keys/request.d.ts.map +1 -1
- package/dist/keys/request.js.map +1 -1
- package/dist/keys/sign.d.ts +7 -2
- package/dist/keys/sign.d.ts.map +1 -1
- package/dist/keys/sign.js +10 -3
- package/dist/keys/sign.js.map +1 -1
- package/dist/keys/signed.d.ts +3 -3
- package/dist/keys/signed.js +3 -3
- package/dist/keys/store.js +1 -1
- package/dist/largeattachment/crypto.d.ts +1 -1
- package/dist/largeattachment/crypto.js +2 -2
- package/dist/largeattachment/upload.d.ts +3 -3
- package/dist/largeattachment/upload.js +1 -1
- package/dist/migration/index.d.ts +1 -1
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +1 -1
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/lockout.d.ts +2 -2
- package/dist/migration/lockout.js +2 -2
- package/dist/migration/migration.d.ts +6 -4
- package/dist/migration/migration.d.ts.map +1 -1
- package/dist/migration/migration.js +3 -3
- package/dist/migration/migration.js.map +1 -1
- package/dist/migration/notice.d.ts +31 -19
- package/dist/migration/notice.d.ts.map +1 -1
- package/dist/migration/notice.js +37 -71
- package/dist/migration/notice.js.map +1 -1
- package/dist/migration/orchestrate.d.ts +10 -10
- package/dist/migration/orchestrate.d.ts.map +1 -1
- package/dist/migration/orchestrate.js +23 -23
- package/dist/migration/orchestrate.js.map +1 -1
- package/dist/migration/sign.js +9 -9
- package/dist/migration/sign.js.map +1 -1
- package/dist/migration/types.d.ts +35 -29
- package/dist/migration/types.d.ts.map +1 -1
- package/dist/migration/types.js +5 -7
- package/dist/migration/types.js.map +1 -1
- package/dist/recovery/bundle_store.js +1 -1
- package/dist/recovery/sign.js +3 -3
- package/dist/recovery/types.d.ts +3 -3
- package/dist/reputation/abuse_report.d.ts +3 -3
- package/dist/reputation/abuse_report.js +2 -2
- package/dist/reputation/eligibility.d.ts +44 -0
- package/dist/reputation/eligibility.d.ts.map +1 -0
- package/dist/reputation/eligibility.js +58 -0
- package/dist/reputation/eligibility.js.map +1 -0
- package/dist/reputation/evidence.d.ts +47 -0
- package/dist/reputation/evidence.d.ts.map +1 -0
- package/dist/reputation/evidence.js +117 -0
- package/dist/reputation/evidence.js.map +1 -0
- package/dist/reputation/gossip_fetch.d.ts +2 -2
- package/dist/reputation/gossip_fetch.js +1 -1
- package/dist/reputation/index.d.ts +4 -1
- package/dist/reputation/index.d.ts.map +1 -1
- package/dist/reputation/index.js +4 -1
- package/dist/reputation/index.js.map +1 -1
- package/dist/reputation/pow.d.ts +1 -1
- package/dist/reputation/pow.js +1 -1
- package/dist/reputation/references.d.ts +51 -0
- package/dist/reputation/references.d.ts.map +1 -0
- package/dist/reputation/references.js +95 -0
- package/dist/reputation/references.js.map +1 -0
- package/dist/reputation/sign.d.ts +1 -1
- package/dist/reputation/sign.js +2 -2
- package/dist/reputation/types.d.ts +46 -2
- package/dist/reputation/types.d.ts.map +1 -1
- package/dist/reputation/types.js +14 -0
- package/dist/reputation/types.js.map +1 -1
- package/dist/reputation/whois.d.ts +1 -1
- package/dist/reputation/whois.js +1 -1
- package/dist/seal/wrap.d.ts +2 -2
- package/dist/seal/wrap.js +4 -4
- package/dist/session/dispatcher.d.ts +3 -3
- package/dist/session/dispatcher.js +1 -1
- package/dist/session/rekey_seal.d.ts +3 -3
- package/dist/session/rekey_seal.js +3 -3
- package/dist/session/session.d.ts +3 -3
- package/dist/session/session.js +3 -3
- package/dist/transparency/log.d.ts +1 -1
- package/dist/transparency/log.js +2 -2
- package/dist/transparency/types.d.ts +2 -2
- package/dist/transparency/types.js +1 -1
- package/dist/transport/h2.d.ts +33 -12
- package/dist/transport/h2.d.ts.map +1 -1
- package/dist/transport/h2.js +40 -13
- package/dist/transport/h2.js.map +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.d.ts.map +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/memory.js +1 -1
- package/dist/transport/ws.d.ts +1 -1
- package/dist/transport/ws.js +1 -1
- package/package.json +1 -1
package/dist/keys/sign.d.ts
CHANGED
|
@@ -41,9 +41,14 @@ export declare function sign(seed: Uint8Array, message: Uint8Array): Uint8Array;
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function verify(publicKey: Uint8Array, signature: Uint8Array, message: Uint8Array): boolean;
|
|
43
43
|
/**
|
|
44
|
-
* Compute the SEMP key fingerprint per `KEY.md` §3
|
|
45
|
-
* the raw
|
|
44
|
+
* Compute the SEMP key fingerprint per `KEY.md` §3 - SHA-256 of
|
|
45
|
+
* the raw public key bytes, lowercase-hex encoded. Used as the
|
|
46
46
|
* `key_id` field everywhere keys are referenced.
|
|
47
|
+
*
|
|
48
|
+
* Accepts public keys of any non-empty length. Ed25519 identity
|
|
49
|
+
* keys are 32 bytes, X25519 baseline encryption keys are 32 bytes,
|
|
50
|
+
* Kyber768+X25519 hybrid encryption keys are 1216 bytes, and so on
|
|
51
|
+
* across the negotiated suite.
|
|
47
52
|
*/
|
|
48
53
|
export declare function fingerprint(publicKey: Uint8Array): string;
|
|
49
54
|
//# sourceMappingURL=sign.d.ts.map
|
package/dist/keys/sign.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../src/keys/sign.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,kDAAkD;AAClD,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,mDAAmD;AACnD,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,iDAAiD;AACjD,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAG9D;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAGtE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CACpB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,UAAU,GAClB,OAAO,CAST;AAED
|
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../src/keys/sign.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,kDAAkD;AAClD,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,mDAAmD;AACnD,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,iDAAiD;AACjD,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAG9D;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAGtE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CACpB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,UAAU,GAClB,OAAO,CAST;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAUzD"}
|
package/dist/keys/sign.js
CHANGED
|
@@ -59,12 +59,19 @@ export function verify(publicKey, signature, message) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Compute the SEMP key fingerprint per `KEY.md` §3
|
|
63
|
-
* the raw
|
|
62
|
+
* Compute the SEMP key fingerprint per `KEY.md` §3 - SHA-256 of
|
|
63
|
+
* the raw public key bytes, lowercase-hex encoded. Used as the
|
|
64
64
|
* `key_id` field everywhere keys are referenced.
|
|
65
|
+
*
|
|
66
|
+
* Accepts public keys of any non-empty length. Ed25519 identity
|
|
67
|
+
* keys are 32 bytes, X25519 baseline encryption keys are 32 bytes,
|
|
68
|
+
* Kyber768+X25519 hybrid encryption keys are 1216 bytes, and so on
|
|
69
|
+
* across the negotiated suite.
|
|
65
70
|
*/
|
|
66
71
|
export function fingerprint(publicKey) {
|
|
67
|
-
|
|
72
|
+
if (publicKey.length === 0) {
|
|
73
|
+
throw new Error("keys: publicKey is empty");
|
|
74
|
+
}
|
|
68
75
|
const sum = sha256(publicKey);
|
|
69
76
|
let s = "";
|
|
70
77
|
for (let i = 0; i < sum.length; i++) {
|
package/dist/keys/sign.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign.js","sourceRoot":"","sources":["../../src/keys/sign.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,kDAAkD;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,mDAAmD;AACnD,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAC3B,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAChD,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,IAAgB,EAAE,OAAmB;IACxD,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CACpB,SA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,aAAa,IAAI,SAAS,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;QAC7E,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,SAAqB;IAC/C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,CAAa,EAAE,IAAY;IAC7D,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC,CAAC,MAAM,UAAU,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
package/dist/keys/signed.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Signed-document compose helpers.
|
|
3
3
|
*
|
|
4
|
-
* Every Ed25519-signed SEMP document
|
|
4
|
+
* Every Ed25519-signed SEMP document - closure request, configuration
|
|
5
5
|
* update, user policy, migration record, sender-signature enclosure,
|
|
6
6
|
* delivery receipt, transparency STH, recovery manifest, recovery
|
|
7
|
-
* share, handshake response/accepted/rejected
|
|
7
|
+
* share, handshake response/accepted/rejected - follows the same
|
|
8
8
|
* shape: build the document with the signature value blanked,
|
|
9
9
|
* canonicalize per ENVELOPE.md §4.3, prepend a domain-separation
|
|
10
10
|
* prefix, sign with Ed25519, write the signature back into the
|
|
@@ -73,7 +73,7 @@ export interface VerifySignedDocResult {
|
|
|
73
73
|
* Throws if the document is structurally malformed (path missing,
|
|
74
74
|
* signature not a string, signature not valid base64). A successful
|
|
75
75
|
* parse with a bad signature returns `{ ok: false, canonicalBlanked }`
|
|
76
|
-
*
|
|
76
|
+
* - the canonical bytes are returned so callers can cross-check
|
|
77
77
|
* pinned `intermediates.canonical_with_blanked_signature_utf8`.
|
|
78
78
|
*/
|
|
79
79
|
export declare function verifySignedDoc(spec: VerifySignedDocSpec): VerifySignedDocResult;
|
package/dist/keys/signed.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Signed-document compose helpers.
|
|
3
3
|
*
|
|
4
|
-
* Every Ed25519-signed SEMP document
|
|
4
|
+
* Every Ed25519-signed SEMP document - closure request, configuration
|
|
5
5
|
* update, user policy, migration record, sender-signature enclosure,
|
|
6
6
|
* delivery receipt, transparency STH, recovery manifest, recovery
|
|
7
|
-
* share, handshake response/accepted/rejected
|
|
7
|
+
* share, handshake response/accepted/rejected - follows the same
|
|
8
8
|
* shape: build the document with the signature value blanked,
|
|
9
9
|
* canonicalize per ENVELOPE.md §4.3, prepend a domain-separation
|
|
10
10
|
* prefix, sign with Ed25519, write the signature back into the
|
|
@@ -42,7 +42,7 @@ export function signSignedDoc(spec) {
|
|
|
42
42
|
* Throws if the document is structurally malformed (path missing,
|
|
43
43
|
* signature not a string, signature not valid base64). A successful
|
|
44
44
|
* parse with a bad signature returns `{ ok: false, canonicalBlanked }`
|
|
45
|
-
*
|
|
45
|
+
* - the canonical bytes are returned so callers can cross-check
|
|
46
46
|
* pinned `intermediates.canonical_with_blanked_signature_utf8`.
|
|
47
47
|
*/
|
|
48
48
|
export function verifySignedDoc(spec) {
|
package/dist/keys/store.js
CHANGED
|
@@ -81,7 +81,7 @@ export class InMemoryKeyStore {
|
|
|
81
81
|
return this.deviceCerts.get(deviceKeyId) ?? null;
|
|
82
82
|
}
|
|
83
83
|
putDeviceCertificate(cert) {
|
|
84
|
-
// Stored under the delegated device's public-key fingerprint
|
|
84
|
+
// Stored under the delegated device's public-key fingerprint -
|
|
85
85
|
// matches the LookupDeviceCertificate(fp) parameter shape used
|
|
86
86
|
// by the scope-enforcement path. Callers compute the fingerprint
|
|
87
87
|
// from cert.device_public_key.
|
|
@@ -22,7 +22,7 @@ export declare function deriveAttachmentKey(kEnclosure: Uint8Array, attachmentId
|
|
|
22
22
|
* AEAD additional-data input bound into each attachment's
|
|
23
23
|
* ciphertext per §3.2: canonical UTF-8 JSON of the item with
|
|
24
24
|
* `ciphertext_hash`, `aead_nonce`, and `extensions` set to empty
|
|
25
|
-
* values (`""`, `""`, `{}`
|
|
25
|
+
* values (`""`, `""`, `{}` - but `extensions` is dropped by the
|
|
26
26
|
* canonicalizer when it's the optional `extensions` field).
|
|
27
27
|
*
|
|
28
28
|
* Binding the metadata into AAD prevents an attacker from swapping
|
|
@@ -37,7 +37,7 @@ export function deriveAttachmentKey(kEnclosure, attachmentId, outputLen) {
|
|
|
37
37
|
* AEAD additional-data input bound into each attachment's
|
|
38
38
|
* ciphertext per §3.2: canonical UTF-8 JSON of the item with
|
|
39
39
|
* `ciphertext_hash`, `aead_nonce`, and `extensions` set to empty
|
|
40
|
-
* values (`""`, `""`, `{}`
|
|
40
|
+
* values (`""`, `""`, `{}` - but `extensions` is dropped by the
|
|
41
41
|
* canonicalizer when it's the optional `extensions` field).
|
|
42
42
|
*
|
|
43
43
|
* Binding the metadata into AAD prevents an attacker from swapping
|
|
@@ -112,7 +112,7 @@ export function validateUrl(raw) {
|
|
|
112
112
|
// URL may still reveal them. We accept IPv6 if it parses as an IP
|
|
113
113
|
// and contains ':'.
|
|
114
114
|
if (looksLikeIPv6(host)) {
|
|
115
|
-
return; // IPv6 literal
|
|
115
|
+
return; // IPv6 literal - accepted
|
|
116
116
|
}
|
|
117
117
|
if (looksLikeIPv4(host)) {
|
|
118
118
|
throw new Error(`largeattachment: url host ${JSON.stringify(host)} is a bare IPv4 literal; FQDN required`);
|
|
@@ -9,7 +9,7 @@ import { type Item } from "./types.js";
|
|
|
9
9
|
export type AttachmentSuite = "x25519-chacha20-poly1305" | "pq-kyber768-x25519";
|
|
10
10
|
/** Inputs to {@link encryptAttachment}. */
|
|
11
11
|
export interface EncryptAttachmentInput {
|
|
12
|
-
/** Negotiated session suite
|
|
12
|
+
/** Negotiated session suite - selects the AEAD per §3.2. */
|
|
13
13
|
suite: AttachmentSuite;
|
|
14
14
|
/** 32-byte K_enclosure from the envelope this item belongs to. */
|
|
15
15
|
kEnclosure: Uint8Array;
|
|
@@ -32,7 +32,7 @@ export interface EncryptAttachmentInput {
|
|
|
32
32
|
export interface EncryptAttachmentResult {
|
|
33
33
|
/** Fully populated item ready to drop into the enclosure. */
|
|
34
34
|
item: Item;
|
|
35
|
-
/** AEAD ciphertext bytes
|
|
35
|
+
/** AEAD ciphertext bytes - uploaded by the caller to `item.url`. */
|
|
36
36
|
ciphertext: Uint8Array;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -40,7 +40,7 @@ export interface EncryptAttachmentResult {
|
|
|
40
40
|
* plaintext, populate the item with `ciphertext_hash` and return
|
|
41
41
|
* the bytes the caller uploads to `item.url`.
|
|
42
42
|
*
|
|
43
|
-
* Does NOT upload anything
|
|
43
|
+
* Does NOT upload anything - the caller PUTs `ciphertext` to `url`.
|
|
44
44
|
*/
|
|
45
45
|
export declare function encryptAttachment(input: EncryptAttachmentInput): EncryptAttachmentResult;
|
|
46
46
|
/**
|
|
@@ -12,7 +12,7 @@ import { AEADChaCha20Poly1305, AEADXChaCha20Poly1305, } from "./types.js";
|
|
|
12
12
|
* plaintext, populate the item with `ciphertext_hash` and return
|
|
13
13
|
* the bytes the caller uploads to `item.url`.
|
|
14
14
|
*
|
|
15
|
-
* Does NOT upload anything
|
|
15
|
+
* Does NOT upload anything - the caller PUTs `ciphertext` to `url`.
|
|
16
16
|
*/
|
|
17
17
|
export function encryptAttachment(input) {
|
|
18
18
|
if (input.kEnclosure.length === 0) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
|
-
export { type MigrationMode, type MigrationNotice, type MigrationNoticeRejection, type MigrationRecord, type MigrationSignatureBlock,
|
|
10
|
+
export { type MigrationMode, type MigrationNotice, type MigrationNoticeRejection, type MigrationRecord, type MigrationSignatureBlock, MaxNoticeWindowMs, MigrationPrefix, MigrationRecordType, MigrationRecordVersion, MinNoticeWindowMs, RecommendedNoticeWindowMs, SignatureAlgorithmEd25519, } from "./types.js";
|
|
11
11
|
export { checkMigratedAtBound, prepareSignatures, signNewDomain, signNewIdentity, signOldDomain, signOldIdentity, validateMigrationRecord, verifyMigrationPass, verifyMigrationRecord, } from "./sign.js";
|
|
12
12
|
export { type ComposeMigrationInput, composeMigrationRecord, } from "./migration.js";
|
|
13
13
|
export { type AcceptSubmissionInput, type BuildSubmissionInput, type ThirdPartyHook, type ThirdPartyPolicy, acceptSubmission, applyThirdPartyPolicy, buildSubmission, } from "./orchestrate.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,KAAK,qBAAqB,EAC1B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,yBAAyB,EAC9B,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,gBAAgB,EACrB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
package/dist/migration/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
|
-
export {
|
|
10
|
+
export { MaxNoticeWindowMs, MigrationPrefix, MigrationRecordType, MigrationRecordVersion, MinNoticeWindowMs, RecommendedNoticeWindowMs, SignatureAlgorithmEd25519, } from "./types.js";
|
|
11
11
|
export { checkMigratedAtBound, prepareSignatures, signNewDomain, signNewIdentity, signOldDomain, signOldIdentity, validateMigrationRecord, verifyMigrationPass, verifyMigrationRecord, } from "./sign.js";
|
|
12
12
|
export { composeMigrationRecord, } from "./migration.js";
|
|
13
13
|
export { acceptSubmission, applyThirdPartyPolicy, buildSubmission, } from "./orchestrate.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAML,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAML,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAEL,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAKL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAGL,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAEL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Local-part lockout registry per MIGRATION.md §6.
|
|
3
3
|
*
|
|
4
4
|
* After a cooperative migration finalizes, the old provider MUST
|
|
5
|
-
* lock out the old local-part for the duration of the
|
|
5
|
+
* lock out the old local-part for the duration of the notice
|
|
6
6
|
* window so a different account cannot be reassigned the old
|
|
7
|
-
* address while
|
|
7
|
+
* address while the migration notice is still being served.
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Local-part lockout registry per MIGRATION.md §6.
|
|
3
3
|
*
|
|
4
4
|
* After a cooperative migration finalizes, the old provider MUST
|
|
5
|
-
* lock out the old local-part for the duration of the
|
|
5
|
+
* lock out the old local-part for the duration of the notice
|
|
6
6
|
* window so a different account cannot be reassigned the old
|
|
7
|
-
* address while
|
|
7
|
+
* address while the migration notice is still being served.
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
@@ -18,11 +18,13 @@ export interface ComposeMigrationInput {
|
|
|
18
18
|
/** ISO 8601 UTC timestamp the migration was effected. */
|
|
19
19
|
migratedAt: string;
|
|
20
20
|
/**
|
|
21
|
-
* ISO 8601 UTC
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* ISO 8601 UTC end of the migration notice window. During this
|
|
22
|
+
* window the old provider serves migration_notice on rejections
|
|
23
|
+
* and migration_to on key fetches. REQUIRED when
|
|
24
|
+
* `mode === "cooperative"`. Pass null/undefined in unilateral
|
|
25
|
+
* mode to omit.
|
|
24
26
|
*/
|
|
25
|
-
|
|
27
|
+
noticeWindowUntil?: string | null;
|
|
26
28
|
oldAddress: string;
|
|
27
29
|
newAddress: string;
|
|
28
30
|
oldIdentityKeyId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,eAAe,EAGhB,MAAM,YAAY,CAAC;AAEpB,gDAAgD;AAChD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,eAAe,EAGhB,MAAM,YAAY,CAAC;AAEpB,gDAAgD;AAChD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IAEnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,UAAU,CAAC;IAE5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,UAAU,CAAC;IAE5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,UAAU,CAAC;IAE1B,6BAA6B;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,UAAU,CAAC;IAE3B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,qBAAqB,GAC3B,eAAe,CAgDjB;AAGD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -26,10 +26,10 @@ export function composeMigrationRecord(input) {
|
|
|
26
26
|
new_identity_key_id: input.newIdentityKeyId,
|
|
27
27
|
new_identity_public_key: input.newIdentityPublicKey,
|
|
28
28
|
migrated_at: input.migratedAt,
|
|
29
|
-
|
|
30
|
-
input.
|
|
29
|
+
notice_window_until: input.noticeWindowUntil === undefined ||
|
|
30
|
+
input.noticeWindowUntil === ""
|
|
31
31
|
? null
|
|
32
|
-
: input.
|
|
32
|
+
: input.noticeWindowUntil,
|
|
33
33
|
mode: input.mode,
|
|
34
34
|
old_identity_signature: { algorithm: "", key_id: "", value: "" },
|
|
35
35
|
new_identity_signature: { algorithm: "", key_id: "", value: "" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAuCpB;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAA4B;IAE5B,MAAM,CAAC,GAAoB;QACzB,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,sBAAsB;QAC/B,SAAS,EAAE,KAAK,CAAC,QAAQ;QACzB,WAAW,EAAE,KAAK,CAAC,UAAU;QAC7B,WAAW,EAAE,KAAK,CAAC,UAAU;QAC7B,mBAAmB,EAAE,KAAK,CAAC,gBAAgB;QAC3C,mBAAmB,EAAE,KAAK,CAAC,gBAAgB;QAC3C,uBAAuB,EAAE,KAAK,CAAC,oBAAoB;QACnD,WAAW,EAAE,KAAK,CAAC,UAAU;QAC7B,mBAAmB,EACjB,KAAK,CAAC,iBAAiB,KAAK,SAAS;YACrC,KAAK,CAAC,iB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AAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,8CAA8C;AAC9C,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Migration notice
|
|
2
|
+
* Migration notice body construction per MIGRATION.md §5.3.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The migration notice is a body field attached to a
|
|
5
|
+
* policy_forbidden envelope rejection that the old provider emits
|
|
6
|
+
* during the migration notice window. It points the sender at the
|
|
7
|
+
* recipient's new address and at the published migration record
|
|
8
|
+
* (URL + record_id) so the sender's stack can fetch and verify the
|
|
9
|
+
* record before redirecting.
|
|
10
|
+
*
|
|
11
|
+
* After the notice window elapses the old provider stops attaching
|
|
12
|
+
* the notice and handles the old address the same way it handles a
|
|
13
|
+
* non-existent address.
|
|
8
14
|
*
|
|
9
15
|
* @module
|
|
10
16
|
*/
|
|
@@ -12,22 +18,28 @@ import { type MigrationNotice, type MigrationNoticeRejection, type MigrationReco
|
|
|
12
18
|
/** Inputs to {@link buildMigrationNotice}. */
|
|
13
19
|
export interface BuildMigrationNoticeInput {
|
|
14
20
|
record: MigrationRecord;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Optional URL template the operator uses to expose published
|
|
23
|
+
* records (typically
|
|
24
|
+
* "https://<old-domain>/.well-known/semp/migration/<record_id>"
|
|
25
|
+
* per §5.3 example). When the template contains the literal
|
|
26
|
+
* "<record_id>" placeholder the record's ID is substituted;
|
|
27
|
+
* otherwise the template is used verbatim. Omit to exclude
|
|
28
|
+
* migration_record_url from the notice.
|
|
29
|
+
*/
|
|
30
|
+
recordUrlPattern?: string;
|
|
23
31
|
}
|
|
24
32
|
/**
|
|
25
|
-
* Build a {@link MigrationNotice}
|
|
26
|
-
*
|
|
27
|
-
* the underlying record by fetching
|
|
28
|
-
* `verifyMigrationRecord`.
|
|
33
|
+
* Build a {@link MigrationNotice} from a published migration
|
|
34
|
+
* record. The notice is unsigned; the receiving sender verifies
|
|
35
|
+
* the underlying record by fetching migration_record_url and
|
|
36
|
+
* running `verifyMigrationRecord`.
|
|
29
37
|
*/
|
|
30
38
|
export declare function buildMigrationNotice(input: BuildMigrationNoticeInput): MigrationNotice;
|
|
31
|
-
/**
|
|
32
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Wrap a {@link MigrationNotice} in the §5.3 SEMP_ENVELOPE
|
|
41
|
+
* step=rejected response. The reason is a human-readable
|
|
42
|
+
* description; the spec example uses "Recipient has migrated."
|
|
43
|
+
*/
|
|
44
|
+
export declare function newMigrationNoticeRejection(notice: MigrationNotice, reason?: string): MigrationNoticeRejection;
|
|
33
45
|
//# sourceMappingURL=notice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../src/migration/notice.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../src/migration/notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EAErB,MAAM,YAAY,CAAC;AAEpB,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,eAAe,CAAC;IACxB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,eAAe,CAcjB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,eAAe,EACvB,MAAM,SAA4B,GACjC,wBAAwB,CAS1B"}
|
package/dist/migration/notice.js
CHANGED
|
@@ -1,85 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Migration notice
|
|
2
|
+
* Migration notice body construction per MIGRATION.md §5.3.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The migration notice is a body field attached to a
|
|
5
|
+
* policy_forbidden envelope rejection that the old provider emits
|
|
6
|
+
* during the migration notice window. It points the sender at the
|
|
7
|
+
* recipient's new address and at the published migration record
|
|
8
|
+
* (URL + record_id) so the sender's stack can fetch and verify the
|
|
9
|
+
* record before redirecting.
|
|
10
|
+
*
|
|
11
|
+
* After the notice window elapses the old provider stops attaching
|
|
12
|
+
* the notice and handles the old address the same way it handles a
|
|
13
|
+
* non-existent address.
|
|
8
14
|
*
|
|
9
15
|
* @module
|
|
10
16
|
*/
|
|
11
|
-
import {
|
|
17
|
+
import { MigrationRecordVersion, } from "./types.js";
|
|
12
18
|
/**
|
|
13
|
-
* Build a {@link MigrationNotice}
|
|
14
|
-
*
|
|
15
|
-
* the underlying record by fetching
|
|
16
|
-
* `verifyMigrationRecord`.
|
|
19
|
+
* Build a {@link MigrationNotice} from a published migration
|
|
20
|
+
* record. The notice is unsigned; the receiving sender verifies
|
|
21
|
+
* the underlying record by fetching migration_record_url and
|
|
22
|
+
* running `verifyMigrationRecord`.
|
|
17
23
|
*/
|
|
18
24
|
export function buildMigrationNotice(input) {
|
|
19
|
-
|
|
20
|
-
throw new Error("migration: recordUrlPattern must include {record_id} placeholder");
|
|
21
|
-
}
|
|
22
|
-
const recordUrl = input.recordUrlPattern.replace("{record_id}", encodeURIComponent(input.record.record_id));
|
|
23
|
-
const noticeId = input.noticeId ?? newULID(input.rand);
|
|
24
|
-
const nowFn = input.nowFn ?? (() => new Date());
|
|
25
|
-
return {
|
|
26
|
-
type: MigrationNoticeType,
|
|
27
|
-
version: MigrationRecordVersion,
|
|
28
|
-
notice_id: noticeId,
|
|
29
|
-
record_id: input.record.record_id,
|
|
30
|
-
record_url: recordUrl,
|
|
31
|
-
old_address: input.record.old_address,
|
|
25
|
+
const notice = {
|
|
32
26
|
new_address: input.record.new_address,
|
|
33
|
-
|
|
34
|
-
issued_at: isoSecond(nowFn()),
|
|
27
|
+
migration_record_id: input.record.record_id,
|
|
35
28
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
// Helpers (inlined ULID minter — same as elsewhere in the codebase)
|
|
43
|
-
const ULID_ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
44
|
-
function newULID(rand) {
|
|
45
|
-
const r = rand ?? defaultRand;
|
|
46
|
-
const bits = new Uint8Array(16);
|
|
47
|
-
const ms = BigInt(Date.now());
|
|
48
|
-
bits[0] = Number((ms >> 40n) & 0xffn);
|
|
49
|
-
bits[1] = Number((ms >> 32n) & 0xffn);
|
|
50
|
-
bits[2] = Number((ms >> 24n) & 0xffn);
|
|
51
|
-
bits[3] = Number((ms >> 16n) & 0xffn);
|
|
52
|
-
bits[4] = Number((ms >> 8n) & 0xffn);
|
|
53
|
-
bits[5] = Number(ms & 0xffn);
|
|
54
|
-
const random = r(10);
|
|
55
|
-
for (let i = 0; i < 10; i++) {
|
|
56
|
-
bits[6 + i] = random[i] ?? 0;
|
|
57
|
-
}
|
|
58
|
-
let u = 0n;
|
|
59
|
-
for (let i = 0; i < 8; i++) {
|
|
60
|
-
u = (u << 8n) | BigInt(bits[i] ?? 0);
|
|
61
|
-
}
|
|
62
|
-
let u2 = 0n;
|
|
63
|
-
for (let i = 8; i < 16; i++) {
|
|
64
|
-
u2 = (u2 << 8n) | BigInt(bits[i] ?? 0);
|
|
29
|
+
if (input.recordUrlPattern !== undefined && input.recordUrlPattern !== "") {
|
|
30
|
+
notice.migration_record_url = input.recordUrlPattern.includes("<record_id>")
|
|
31
|
+
? input.recordUrlPattern.replaceAll("<record_id>", input.record.record_id)
|
|
32
|
+
: input.recordUrlPattern;
|
|
65
33
|
}
|
|
66
|
-
|
|
67
|
-
for (let i = 25; i >= 13; i--) {
|
|
68
|
-
out[i] = ULID_ALPHABET[Number(u2 & 31n)] ?? "0";
|
|
69
|
-
u2 >>= 5n;
|
|
70
|
-
}
|
|
71
|
-
for (let i = 12; i >= 0; i--) {
|
|
72
|
-
out[i] = ULID_ALPHABET[Number(u & 31n)] ?? "0";
|
|
73
|
-
u >>= 5n;
|
|
74
|
-
}
|
|
75
|
-
return out.join("");
|
|
34
|
+
return notice;
|
|
76
35
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function
|
|
83
|
-
return
|
|
36
|
+
/**
|
|
37
|
+
* Wrap a {@link MigrationNotice} in the §5.3 SEMP_ENVELOPE
|
|
38
|
+
* step=rejected response. The reason is a human-readable
|
|
39
|
+
* description; the spec example uses "Recipient has migrated."
|
|
40
|
+
*/
|
|
41
|
+
export function newMigrationNoticeRejection(notice, reason = "Recipient has migrated.") {
|
|
42
|
+
return {
|
|
43
|
+
type: "SEMP_ENVELOPE",
|
|
44
|
+
step: "rejected",
|
|
45
|
+
version: MigrationRecordVersion,
|
|
46
|
+
reason_code: "policy_forbidden",
|
|
47
|
+
reason,
|
|
48
|
+
migration_notice: notice,
|
|
49
|
+
};
|
|
84
50
|
}
|
|
85
51
|
//# sourceMappingURL=notice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice.js","sourceRoot":"","sources":["../../src/migration/notice.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notice.js","sourceRoot":"","sources":["../../src/migration/notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAIL,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAiBpB;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAgC;IAEhC,MAAM,MAAM,GAAoB;QAC9B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QACrC,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;KAC5C,CAAC;IACF,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,IAAI,KAAK,CAAC,gBAAgB,KAAK,EAAE,EAAE,CAAC;QAC1E,MAAM,CAAC,oBAAoB,GAAG,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC1E,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAC/B,aAAa,EACb,KAAK,CAAC,MAAM,CAAC,SAAS,CACvB;YACH,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC7B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAuB,EACvB,MAAM,GAAG,yBAAyB;IAElC,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EAAE,kBAAkB;QAC/B,MAAM;QACN,gBAAgB,EAAE,MAAM;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The new provider builds a 3-signature submission record and POSTs
|
|
6
6
|
* it to the old provider's migration endpoint. The old provider
|
|
7
|
-
* verifies the three submitted signatures, applies its
|
|
7
|
+
* verifies the three submitted signatures, applies its notice
|
|
8
8
|
* policy, registers the §6 lockout, countersigns, persists, and
|
|
9
9
|
* returns the final 4-signature record.
|
|
10
10
|
*
|
|
11
|
-
* Unilateral mode skips the countersign step
|
|
11
|
+
* Unilateral mode skips the countersign step - the new provider's
|
|
12
12
|
* 3-signature record is the final published form.
|
|
13
13
|
*
|
|
14
14
|
* @module
|
|
@@ -31,8 +31,8 @@ export interface BuildSubmissionInput {
|
|
|
31
31
|
/** Old provider's domain signing fingerprint (cooperative only). */
|
|
32
32
|
oldDomainKeyId?: string;
|
|
33
33
|
mode: MigrationMode;
|
|
34
|
-
/**
|
|
35
|
-
|
|
34
|
+
/** Notice window in milliseconds. Cooperative mode only. */
|
|
35
|
+
noticeWindowMs?: number;
|
|
36
36
|
/** ISO 8601 UTC. */
|
|
37
37
|
migratedAt: string;
|
|
38
38
|
/** Optional pre-assigned record_id; auto-generated when omitted. */
|
|
@@ -41,9 +41,9 @@ export interface BuildSubmissionInput {
|
|
|
41
41
|
rand?: (n: number) => Uint8Array;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Construct and apply the new-provider signatures (passes 1
|
|
44
|
+
* Construct and apply the new-provider signatures (passes 1-3). In
|
|
45
45
|
* cooperative mode the returned record's `old_domain_signature`
|
|
46
|
-
* slot is prepared but empty
|
|
46
|
+
* slot is prepared but empty - the new provider POSTs the record
|
|
47
47
|
* to the old provider, who runs {@link acceptSubmission} to verify
|
|
48
48
|
* and countersign.
|
|
49
49
|
*/
|
|
@@ -66,10 +66,10 @@ export interface AcceptSubmissionInput {
|
|
|
66
66
|
/** Optional clock-skew tolerance. Defaults to 5 minutes. */
|
|
67
67
|
clockSkewMs?: number;
|
|
68
68
|
/**
|
|
69
|
-
* Optional
|
|
69
|
+
* Optional notice-policy hook. Called BEFORE countersigning.
|
|
70
70
|
* Throw to refuse the submission with a structured reason.
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
noticePolicy?: (r: MigrationRecord) => Promise<void> | void;
|
|
73
73
|
/** Optional persistence layer. */
|
|
74
74
|
store?: PublicationStore;
|
|
75
75
|
/** Optional lockout registry. */
|
|
@@ -77,11 +77,11 @@ export interface AcceptSubmissionInput {
|
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Old-provider side of cooperative migration: verify the 3
|
|
80
|
-
* submitted signatures, apply optional
|
|
80
|
+
* submitted signatures, apply optional notice policy, register
|
|
81
81
|
* the §6 lockout, countersign with `old_domain_priv`, persist via
|
|
82
82
|
* the store, and return the 4-sig record.
|
|
83
83
|
*
|
|
84
|
-
* In unilateral mode this throws
|
|
84
|
+
* In unilateral mode this throws - there is no countersignature
|
|
85
85
|
* step in the unilateral flow.
|
|
86
86
|
*/
|
|
87
87
|
export declare function acceptSubmission(input: AcceptSubmissionInput): Promise<MigrationRecord>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../../src/migration/orchestrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EAKrB,MAAM,YAAY,CAAC;AAEpB,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,oBAAoB,EAAE,MAAM,CAAC;IAE7B,eAAe,EAAE,UAAU,CAAC;IAC5B,eAAe,EAAE,UAAU,CAAC;IAE5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,UAAU,CAAC;IAE1B,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,IAAI,EAAE,aAAa,CAAC;IAEpB,
|
|
1
|
+
{"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../../src/migration/orchestrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,gBAAgB,EACtB,MAA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