@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.
Files changed (231) hide show
  1. package/dist/brief/address.d.ts +1 -1
  2. package/dist/brief/address.js +1 -1
  3. package/dist/brief/brief.d.ts +1 -1
  4. package/dist/brief/brief.js +1 -1
  5. package/dist/canonical/marshal.d.ts +2 -2
  6. package/dist/canonical/marshal.js +2 -2
  7. package/dist/closure/driver.d.ts +2 -2
  8. package/dist/closure/driver.js +1 -1
  9. package/dist/crypto/aead.d.ts +2 -2
  10. package/dist/crypto/aead.js +2 -2
  11. package/dist/crypto/kdf.d.ts +1 -1
  12. package/dist/crypto/kdf.js +1 -1
  13. package/dist/crypto/mac.d.ts +1 -1
  14. package/dist/crypto/mac.js +1 -1
  15. package/dist/delivery/ack.d.ts +5 -5
  16. package/dist/delivery/ack.js +6 -6
  17. package/dist/delivery/blocklist.d.ts +1 -1
  18. package/dist/delivery/blocklist.js +2 -2
  19. package/dist/delivery/device_sync.d.ts +26 -0
  20. package/dist/delivery/device_sync.d.ts.map +1 -0
  21. package/dist/delivery/device_sync.js +18 -0
  22. package/dist/delivery/device_sync.js.map +1 -0
  23. package/dist/delivery/disposition.d.ts +1 -1
  24. package/dist/delivery/fetch.d.ts +1 -1
  25. package/dist/delivery/fetch.js +1 -1
  26. package/dist/delivery/forwarder.d.ts +9 -1
  27. package/dist/delivery/forwarder.d.ts.map +1 -1
  28. package/dist/delivery/forwarder.js +1 -1
  29. package/dist/delivery/forwarder.js.map +1 -1
  30. package/dist/delivery/inbox.d.ts +2 -2
  31. package/dist/delivery/inbox.js +2 -2
  32. package/dist/delivery/index.d.ts +4 -0
  33. package/dist/delivery/index.d.ts.map +1 -1
  34. package/dist/delivery/index.js +4 -0
  35. package/dist/delivery/index.js.map +1 -1
  36. package/dist/delivery/persistent_silent.d.ts +70 -0
  37. package/dist/delivery/persistent_silent.d.ts.map +1 -0
  38. package/dist/delivery/persistent_silent.js +117 -0
  39. package/dist/delivery/persistent_silent.js.map +1 -0
  40. package/dist/delivery/pipeline.d.ts +4 -4
  41. package/dist/delivery/pipeline.d.ts.map +1 -1
  42. package/dist/delivery/pipeline.js +10 -3
  43. package/dist/delivery/pipeline.js.map +1 -1
  44. package/dist/delivery/policy_state.d.ts +2 -2
  45. package/dist/delivery/policy_state.js +4 -4
  46. package/dist/delivery/receipt.d.ts +3 -3
  47. package/dist/delivery/receipt.js +3 -3
  48. package/dist/delivery/receipt_store.d.ts +1 -1
  49. package/dist/delivery/receipt_store.js +1 -1
  50. package/dist/delivery/retry.d.ts +2 -2
  51. package/dist/delivery/retry.js +2 -2
  52. package/dist/delivery/scheduler.d.ts +1 -1
  53. package/dist/delivery/scheduler.js +1 -1
  54. package/dist/delivery/stage_partition.d.ts +1 -1
  55. package/dist/delivery/stage_partition.js +1 -1
  56. package/dist/delivery/staged_runner.d.ts +1 -1
  57. package/dist/delivery/staged_runner.js +2 -2
  58. package/dist/delivery/status_message.d.ts +75 -0
  59. package/dist/delivery/status_message.d.ts.map +1 -0
  60. package/dist/delivery/status_message.js +109 -0
  61. package/dist/delivery/status_message.js.map +1 -0
  62. package/dist/delivery/upgrade_signal.d.ts +48 -0
  63. package/dist/delivery/upgrade_signal.d.ts.map +1 -0
  64. package/dist/delivery/upgrade_signal.js +48 -0
  65. package/dist/delivery/upgrade_signal.js.map +1 -0
  66. package/dist/discovery/configuration.d.ts +20 -1
  67. package/dist/discovery/configuration.d.ts.map +1 -1
  68. package/dist/discovery/configuration.js.map +1 -1
  69. package/dist/discovery/dns.d.ts +27 -1
  70. package/dist/discovery/dns.d.ts.map +1 -1
  71. package/dist/discovery/dns.js +37 -0
  72. package/dist/discovery/dns.js.map +1 -1
  73. package/dist/discovery/index.d.ts +2 -2
  74. package/dist/discovery/index.d.ts.map +1 -1
  75. package/dist/discovery/index.js +1 -1
  76. package/dist/discovery/index.js.map +1 -1
  77. package/dist/discovery/partition.d.ts +1 -1
  78. package/dist/discovery/partition.js +1 -1
  79. package/dist/discovery/resolver.d.ts +5 -5
  80. package/dist/discovery/resolver.js +5 -5
  81. package/dist/discovery/txt.d.ts +1 -1
  82. package/dist/discovery/txt.js +1 -1
  83. package/dist/enclosure/forwarding.d.ts +1 -1
  84. package/dist/enclosure/forwarding.js +1 -1
  85. package/dist/envelope/buckets.d.ts +2 -2
  86. package/dist/envelope/buckets.js +2 -2
  87. package/dist/envelope/compose.d.ts +2 -2
  88. package/dist/envelope/compose.js +4 -4
  89. package/dist/envelope/encode.d.ts +2 -2
  90. package/dist/envelope/encode.js +3 -3
  91. package/dist/envelope/open_verified.d.ts +1 -1
  92. package/dist/envelope/open_verified.js +1 -1
  93. package/dist/envelope/padding.d.ts +2 -2
  94. package/dist/envelope/padding.js +3 -3
  95. package/dist/envelope/verify.d.ts +1 -1
  96. package/dist/envelope/verify.js +1 -1
  97. package/dist/extensions/index.d.ts +1 -0
  98. package/dist/extensions/index.d.ts.map +1 -1
  99. package/dist/extensions/index.js +1 -0
  100. package/dist/extensions/index.js.map +1 -1
  101. package/dist/extensions/limits.d.ts +2 -2
  102. package/dist/extensions/limits.js +2 -2
  103. package/dist/extensions/validation_failure.d.ts +48 -0
  104. package/dist/extensions/validation_failure.d.ts.map +1 -0
  105. package/dist/extensions/validation_failure.js +25 -0
  106. package/dist/extensions/validation_failure.js.map +1 -0
  107. package/dist/handshake/abort.d.ts +1 -1
  108. package/dist/handshake/abort.js +1 -1
  109. package/dist/handshake/client_state.d.ts +5 -5
  110. package/dist/handshake/client_state.js +5 -5
  111. package/dist/handshake/confirm.d.ts +2 -2
  112. package/dist/handshake/confirm.js +2 -2
  113. package/dist/handshake/driver.d.ts +2 -2
  114. package/dist/handshake/driver.js +1 -1
  115. package/dist/handshake/federation.d.ts +27 -9
  116. package/dist/handshake/federation.d.ts.map +1 -1
  117. package/dist/handshake/federation.js +69 -17
  118. package/dist/handshake/federation.js.map +1 -1
  119. package/dist/handshake/first_contact.d.ts +1 -1
  120. package/dist/handshake/first_contact.js +1 -1
  121. package/dist/handshake/identity.d.ts +1 -1
  122. package/dist/handshake/identity.js +1 -1
  123. package/dist/handshake/index.d.ts +1 -1
  124. package/dist/handshake/index.d.ts.map +1 -1
  125. package/dist/handshake/index.js.map +1 -1
  126. package/dist/handshake/pow.js +1 -1
  127. package/dist/handshake/server_state.d.ts +3 -3
  128. package/dist/handshake/server_state.js +3 -3
  129. package/dist/index.d.ts +1 -1
  130. package/dist/index.js +1 -1
  131. package/dist/keys/compromise.d.ts +2 -2
  132. package/dist/keys/compromise.js +1 -1
  133. package/dist/keys/device_certificate.d.ts +3 -3
  134. package/dist/keys/device_certificate.js +4 -4
  135. package/dist/keys/key_revocation.d.ts +2 -2
  136. package/dist/keys/key_revocation.js +1 -1
  137. package/dist/keys/request.d.ts +17 -3
  138. package/dist/keys/request.d.ts.map +1 -1
  139. package/dist/keys/request.js.map +1 -1
  140. package/dist/keys/sign.d.ts +7 -2
  141. package/dist/keys/sign.d.ts.map +1 -1
  142. package/dist/keys/sign.js +10 -3
  143. package/dist/keys/sign.js.map +1 -1
  144. package/dist/keys/signed.d.ts +3 -3
  145. package/dist/keys/signed.js +3 -3
  146. package/dist/keys/store.js +1 -1
  147. package/dist/largeattachment/crypto.d.ts +1 -1
  148. package/dist/largeattachment/crypto.js +2 -2
  149. package/dist/largeattachment/upload.d.ts +3 -3
  150. package/dist/largeattachment/upload.js +1 -1
  151. package/dist/migration/index.d.ts +1 -1
  152. package/dist/migration/index.d.ts.map +1 -1
  153. package/dist/migration/index.js +1 -1
  154. package/dist/migration/index.js.map +1 -1
  155. package/dist/migration/lockout.d.ts +2 -2
  156. package/dist/migration/lockout.js +2 -2
  157. package/dist/migration/migration.d.ts +6 -4
  158. package/dist/migration/migration.d.ts.map +1 -1
  159. package/dist/migration/migration.js +3 -3
  160. package/dist/migration/migration.js.map +1 -1
  161. package/dist/migration/notice.d.ts +31 -19
  162. package/dist/migration/notice.d.ts.map +1 -1
  163. package/dist/migration/notice.js +37 -71
  164. package/dist/migration/notice.js.map +1 -1
  165. package/dist/migration/orchestrate.d.ts +10 -10
  166. package/dist/migration/orchestrate.d.ts.map +1 -1
  167. package/dist/migration/orchestrate.js +23 -23
  168. package/dist/migration/orchestrate.js.map +1 -1
  169. package/dist/migration/sign.js +9 -9
  170. package/dist/migration/sign.js.map +1 -1
  171. package/dist/migration/types.d.ts +35 -29
  172. package/dist/migration/types.d.ts.map +1 -1
  173. package/dist/migration/types.js +5 -7
  174. package/dist/migration/types.js.map +1 -1
  175. package/dist/recovery/bundle_store.js +1 -1
  176. package/dist/recovery/sign.js +3 -3
  177. package/dist/recovery/types.d.ts +3 -3
  178. package/dist/reputation/abuse_report.d.ts +3 -3
  179. package/dist/reputation/abuse_report.js +2 -2
  180. package/dist/reputation/eligibility.d.ts +44 -0
  181. package/dist/reputation/eligibility.d.ts.map +1 -0
  182. package/dist/reputation/eligibility.js +58 -0
  183. package/dist/reputation/eligibility.js.map +1 -0
  184. package/dist/reputation/evidence.d.ts +47 -0
  185. package/dist/reputation/evidence.d.ts.map +1 -0
  186. package/dist/reputation/evidence.js +117 -0
  187. package/dist/reputation/evidence.js.map +1 -0
  188. package/dist/reputation/gossip_fetch.d.ts +2 -2
  189. package/dist/reputation/gossip_fetch.js +1 -1
  190. package/dist/reputation/index.d.ts +4 -1
  191. package/dist/reputation/index.d.ts.map +1 -1
  192. package/dist/reputation/index.js +4 -1
  193. package/dist/reputation/index.js.map +1 -1
  194. package/dist/reputation/pow.d.ts +1 -1
  195. package/dist/reputation/pow.js +1 -1
  196. package/dist/reputation/references.d.ts +51 -0
  197. package/dist/reputation/references.d.ts.map +1 -0
  198. package/dist/reputation/references.js +95 -0
  199. package/dist/reputation/references.js.map +1 -0
  200. package/dist/reputation/sign.d.ts +1 -1
  201. package/dist/reputation/sign.js +2 -2
  202. package/dist/reputation/types.d.ts +46 -2
  203. package/dist/reputation/types.d.ts.map +1 -1
  204. package/dist/reputation/types.js +14 -0
  205. package/dist/reputation/types.js.map +1 -1
  206. package/dist/reputation/whois.d.ts +1 -1
  207. package/dist/reputation/whois.js +1 -1
  208. package/dist/seal/wrap.d.ts +2 -2
  209. package/dist/seal/wrap.js +4 -4
  210. package/dist/session/dispatcher.d.ts +3 -3
  211. package/dist/session/dispatcher.js +1 -1
  212. package/dist/session/rekey_seal.d.ts +3 -3
  213. package/dist/session/rekey_seal.js +3 -3
  214. package/dist/session/session.d.ts +3 -3
  215. package/dist/session/session.js +3 -3
  216. package/dist/transparency/log.d.ts +1 -1
  217. package/dist/transparency/log.js +2 -2
  218. package/dist/transparency/types.d.ts +2 -2
  219. package/dist/transparency/types.js +1 -1
  220. package/dist/transport/h2.d.ts +33 -12
  221. package/dist/transport/h2.d.ts.map +1 -1
  222. package/dist/transport/h2.js +40 -13
  223. package/dist/transport/h2.js.map +1 -1
  224. package/dist/transport/index.d.ts +1 -1
  225. package/dist/transport/index.d.ts.map +1 -1
  226. package/dist/transport/index.js +1 -1
  227. package/dist/transport/index.js.map +1 -1
  228. package/dist/transport/memory.js +1 -1
  229. package/dist/transport/ws.d.ts +1 -1
  230. package/dist/transport/ws.js +1 -1
  231. package/package.json +1 -1
@@ -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 SHA-256 of
45
- * the raw 32-byte public key, lowercase-hex encoded. Used as the
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
@@ -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;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAQzD"}
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 SHA-256 of
63
- * the raw 32-byte public key, lowercase-hex encoded. Used as the
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
- expectLength("publicKey", publicKey, PublicKeySize);
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++) {
@@ -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,EA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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"}
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Signed-document compose helpers.
3
3
  *
4
- * Every Ed25519-signed SEMP document closure request, configuration
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 follows the same
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
- * the canonical bytes are returned so callers can cross-check
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;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Signed-document compose helpers.
3
3
  *
4
- * Every Ed25519-signed SEMP document closure request, configuration
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 follows the same
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
- * the canonical bytes are returned so callers can cross-check
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) {
@@ -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 (`""`, `""`, `{}` but `extensions` is dropped by the
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 (`""`, `""`, `{}` but `extensions` is dropped by the
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 accepted
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 selects the AEAD per §3.2. */
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 uploaded by the caller to `item.url`. */
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 the caller PUTs `ciphertext` to `url`.
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 the caller PUTs `ciphertext` to `url`.
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, MaxForwardingWindowMs, MigrationNoticeType, MigrationPrefix, MigrationRecordType, MigrationRecordVersion, MinForwardingWindowMs, RecommendedForwardingWindowMs, SignatureAlgorithmEd25519, } from "./types.js";
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,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,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"}
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"}
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @module
9
9
  */
10
- export { MaxForwardingWindowMs, MigrationNoticeType, MigrationPrefix, MigrationRecordType, MigrationRecordVersion, MinForwardingWindowMs, RecommendedForwardingWindowMs, SignatureAlgorithmEd25519, } from "./types.js";
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,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,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"}
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 forwarding
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 forwarding is still expected to honor it.
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 forwarding
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 forwarding is still expected to honor it.
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 timestamp until which the old domain forwards.
22
- * REQUIRED when `mode === "cooperative"`. Pass null/undefined in
23
- * unilateral mode to omit.
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
- forwardingWindowUntil?: string | null;
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;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,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"}
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
- forwarding_window_until: input.forwardingWindowUntil === undefined ||
30
- input.forwardingWindowUntil === ""
29
+ notice_window_until: input.noticeWindowUntil === undefined ||
30
+ input.noticeWindowUntil === ""
31
31
  ? null
32
- : input.forwardingWindowUntil,
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 @@
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AAS,EAAE,CAAC;QACnC,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IAClC,CAAC;IACD,iBAAiB,CACf,CAAC,EACD,KAAK,CAAC,gBAAgB,EACtB,KAAK,CAAC,gBAAgB,EACtB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,cAAc,CACrB,CAAC;IACF,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAClE,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAClE,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QACjC,IACE,KAAK,CAAC,aAAa,KAAK,SAAS;YACjC,KAAK,CAAC,cAAc,KAAK,SAAS;YAClC,KAAK,CAAC,cAAc,KAAK,EAAE,EAC3B,CAAC;YACD,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;QACJ,CAAC;QACD,aAAa,CAAC,CAAC,EAAE,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
+ {"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,CA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EAAE,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAClE,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QACjC,IACE,KAAK,CAAC,aAAa,KAAK,SAAS;YACjC,KAAK,CAAC,cAAc,KAAK,SAAS;YAClC,KAAK,CAAC,cAAc,KAAK,EAAE,EAC3B,CAAC;YACD,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;QACJ,CAAC;QACD,aAAa,CAAC,CAAC,EAAE,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 messages per MIGRATION.md §4.
2
+ * Migration notice body construction per MIGRATION.md §5.3.
3
3
  *
4
- * A `SEMP_MIGRATION_NOTICE` is what a server returns to a sender
5
- * that attempted to deliver to a migrated address. It carries a
6
- * pointer to the published migration record (URL + record_id) so
7
- * the sender's stack can fetch and verify it before redirecting.
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
- /** URL pattern with `{record_id}` placeholder, e.g. `https://old.example/migration/{record_id}`. */
16
- recordUrlPattern: string;
17
- /** Optional pre-assigned notice id; auto-generated when omitted. */
18
- noticeId?: string;
19
- /** Wall-clock; defaults to `() => new Date()`. */
20
- nowFn?: () => Date;
21
- /** Random source for ULID generation. */
22
- rand?: (n: number) => Uint8Array;
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} that points at the published
26
- * `record`. The notice is unsigned the recipient sender verifies
27
- * the underlying record by fetching `record_url` and running
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
- /** Construct a rejection wrapper to refuse honoring a notice. */
32
- export declare function newMigrationNoticeRejection(notice: MigrationNotice, reason: string): MigrationNoticeRejection;
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;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EAGrB,MAAM,YAAY,CAAC;AAEpB,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,eAAe,CAAC;IACxB,oGAAoG;IACpG,gBAAgB,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,yCAAyC;IACzC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,eAAe,CAuBjB;AAED,iEAAiE;AACjE,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,GACb,wBAAwB,CAE1B"}
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"}
@@ -1,85 +1,51 @@
1
1
  /**
2
- * Migration notice messages per MIGRATION.md §4.
2
+ * Migration notice body construction per MIGRATION.md §5.3.
3
3
  *
4
- * A `SEMP_MIGRATION_NOTICE` is what a server returns to a sender
5
- * that attempted to deliver to a migrated address. It carries a
6
- * pointer to the published migration record (URL + record_id) so
7
- * the sender's stack can fetch and verify it before redirecting.
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 { MigrationNoticeType, MigrationRecordVersion, } from "./types.js";
17
+ import { MigrationRecordVersion, } from "./types.js";
12
18
  /**
13
- * Build a {@link MigrationNotice} that points at the published
14
- * `record`. The notice is unsigned the recipient sender verifies
15
- * the underlying record by fetching `record_url` and running
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
- if (input.recordUrlPattern === "" || !input.recordUrlPattern.includes("{record_id}")) {
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
- mode: input.record.mode,
34
- issued_at: isoSecond(nowFn()),
27
+ migration_record_id: input.record.record_id,
35
28
  };
36
- }
37
- /** Construct a rejection wrapper to refuse honoring a notice. */
38
- export function newMigrationNoticeRejection(notice, reason) {
39
- return { notice, reason };
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
- const out = new Array(26);
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
- function defaultRand(n) {
78
- const out = new Uint8Array(n);
79
- globalThis.crypto.getRandomValues(out);
80
- return out;
81
- }
82
- function isoSecond(d) {
83
- return d.toISOString().replace(/\.\d{3}Z$/, "Z");
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;;;;;;;;;GASG;AAEH,OAAO,EAIL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAepB;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAgC;IAEhC,IAAI,KAAK,CAAC,gBAAgB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACrF,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAC9C,aAAa,EACb,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAC3C,CAAC;IACF,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAChD,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,sBAAsB;QAC/B,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;QACjC,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QACrC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QACrC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;QACvB,SAAS,EAAE,SAAS,CAAC,KAAK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 -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 forwarding
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 the new provider's
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
- /** Forwarding window in milliseconds. Cooperative mode only. */
35
- forwardingWindowMs?: number;
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 13). In
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 the new provider POSTs the record
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 forwarding-policy hook. Called BEFORE countersigning.
69
+ * Optional notice-policy hook. Called BEFORE countersigning.
70
70
  * Throw to refuse the submission with a structured reason.
71
71
  */
72
- forwardingPolicy?: (r: MigrationRecord) => Promise<void> | void;
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 forwarding policy, register
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 there is no countersignature
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,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,oBAAoB;IACpB,UAAU,EAAE,MAAM,CAAC;IAEn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