@sempdev/semp 0.5.1 → 0.5.5
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/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.js +2 -2
- 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 +17 -2
- package/dist/envelope/compose.d.ts.map +1 -1
- package/dist/envelope/compose.js +29 -11
- package/dist/envelope/compose.js.map +1 -1
- package/dist/envelope/encode.d.ts +2 -2
- package/dist/envelope/encode.js +3 -3
- package/dist/envelope/index.d.ts +1 -1
- package/dist/envelope/index.d.ts.map +1 -1
- package/dist/envelope/index.js +1 -1
- package/dist/envelope/index.js.map +1 -1
- package/dist/envelope/open_any.d.ts.map +1 -1
- package/dist/envelope/open_any.js +5 -5
- package/dist/envelope/open_any.js.map +1 -1
- 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 +6 -6
- package/dist/handshake/federation.js +5 -5
- 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/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 +1 -1
- package/dist/keys/sign.js +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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Mirror of `semp-go/handshake.Server`: a state machine the caller
|
|
5
5
|
* drives over a transport. The class never performs network I/O
|
|
6
|
-
* directly
|
|
6
|
+
* directly - the caller moves bytes between this object and the
|
|
7
7
|
* underlying transport.
|
|
8
8
|
*
|
|
9
9
|
* Lifecycle:
|
|
@@ -77,7 +77,7 @@ export declare class HandshakeServerRejectionError extends Error {
|
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Stateful handshake server. One instance handles exactly one
|
|
80
|
-
* handshake
|
|
80
|
+
* handshake - discard after success or error. Re-using an instance
|
|
81
81
|
* is a programming error (the state machine is single-shot).
|
|
82
82
|
*/
|
|
83
83
|
export declare class HandshakeServer {
|
|
@@ -96,7 +96,7 @@ export declare class HandshakeServer {
|
|
|
96
96
|
/**
|
|
97
97
|
* Process the client's INIT and produce signed RESPONSE bytes per
|
|
98
98
|
* §2.2 / §2.3. Throws {@link HandshakeServerRejectionError} on
|
|
99
|
-
* suite mismatch
|
|
99
|
+
* suite mismatch - the rejection bytes are accessible on the
|
|
100
100
|
* thrown error for the caller to transmit before closing the
|
|
101
101
|
* transport.
|
|
102
102
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Mirror of `semp-go/handshake.Server`: a state machine the caller
|
|
5
5
|
* drives over a transport. The class never performs network I/O
|
|
6
|
-
* directly
|
|
6
|
+
* directly - the caller moves bytes between this object and the
|
|
7
7
|
* underlying transport.
|
|
8
8
|
*
|
|
9
9
|
* Lifecycle:
|
|
@@ -55,7 +55,7 @@ export class HandshakeServerRejectionError extends Error {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Stateful handshake server. One instance handles exactly one
|
|
58
|
-
* handshake
|
|
58
|
+
* handshake - discard after success or error. Re-using an instance
|
|
59
59
|
* is a programming error (the state machine is single-shot).
|
|
60
60
|
*/
|
|
61
61
|
export class HandshakeServer {
|
|
@@ -88,7 +88,7 @@ export class HandshakeServer {
|
|
|
88
88
|
/**
|
|
89
89
|
* Process the client's INIT and produce signed RESPONSE bytes per
|
|
90
90
|
* §2.2 / §2.3. Throws {@link HandshakeServerRejectionError} on
|
|
91
|
-
* suite mismatch
|
|
91
|
+
* suite mismatch - the rejection bytes are accessible on the
|
|
92
92
|
* thrown error for the caller to transmit before closing the
|
|
93
93
|
* transport.
|
|
94
94
|
*/
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Revoking a device with reason `key_compromise` MUST be done in
|
|
5
5
|
* the same transaction as rotating to a new identity key plus a new
|
|
6
|
-
* encryption key
|
|
6
|
+
* encryption key - the compromised device held the shared identity
|
|
7
7
|
* private key, so the adversary holds it too. A partial cascade
|
|
8
8
|
* (device revoked but identity key not rotated) leaves the account
|
|
9
9
|
* vulnerable and is a specification violation.
|
|
@@ -61,7 +61,7 @@ export interface CompromiseRotationInput {
|
|
|
61
61
|
userId: string;
|
|
62
62
|
/** Device being revoked. */
|
|
63
63
|
compromisedDeviceId: string;
|
|
64
|
-
/** Device producing the cascade
|
|
64
|
+
/** Device producing the cascade - recorded as `revoked_by_device_id`. */
|
|
65
65
|
revokingDeviceId: string;
|
|
66
66
|
/** 32-byte Ed25519 seed for the prior identity key. */
|
|
67
67
|
priorIdentitySeed: Uint8Array;
|
package/dist/keys/compromise.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Revoking a device with reason `key_compromise` MUST be done in
|
|
5
5
|
* the same transaction as rotating to a new identity key plus a new
|
|
6
|
-
* encryption key
|
|
6
|
+
* encryption key - the compromised device held the shared identity
|
|
7
7
|
* private key, so the adversary holds it too. A partial cascade
|
|
8
8
|
* (device revoked but identity key not rotated) leaves the account
|
|
9
9
|
* vulnerable and is a specification violation.
|
|
@@ -115,7 +115,7 @@ export interface SignDeviceCertificateResult {
|
|
|
115
115
|
* Compute the issuer's signature over the canonical certificate
|
|
116
116
|
* bytes, then return a copy with `signature.{algorithm,key_id,value}`
|
|
117
117
|
* populated. Pre-populates the algorithm + key_id BEFORE
|
|
118
|
-
* canonicalization so the canonical bytes cover both
|
|
118
|
+
* canonicalization so the canonical bytes cover both - an attacker
|
|
119
119
|
* cannot downgrade the signing algorithm or forge a different
|
|
120
120
|
* issuer fingerprint.
|
|
121
121
|
*/
|
|
@@ -124,7 +124,7 @@ export declare function signDeviceCertificate(input: SignDeviceCertificateInput)
|
|
|
124
124
|
* Ed25519-verify a certificate's signature under `issuerPub`. Returns
|
|
125
125
|
* true when the signature verifies. Does NOT cross-check that the
|
|
126
126
|
* issuer is currently a registered, non-revoked full-access device
|
|
127
|
-
* for the account
|
|
127
|
+
* for the account - that requires a key directory store and is the
|
|
128
128
|
* caller's responsibility.
|
|
129
129
|
*/
|
|
130
130
|
export declare function verifyDeviceCertificate(certificate: DeviceCertificate, issuerPub: Uint8Array): boolean;
|
|
@@ -153,7 +153,7 @@ export interface AddressIdentity {
|
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Report whether `matcher` permits sending to `recipient` per
|
|
156
|
-
* §10.3.3.1. Does NOT evaluate rate limits
|
|
156
|
+
* §10.3.3.1. Does NOT evaluate rate limits - the caller applies
|
|
157
157
|
* rate-limit tiers separately per §10.3.4.
|
|
158
158
|
*/
|
|
159
159
|
export declare function scopeAllowsRecipient(matcher: ScopeMatcher, recipient: AddressIdentity): boolean;
|
|
@@ -39,7 +39,7 @@ export const MaxDeviceCertificateLifetimeMs = 365 * 24 * 3600 * 1000;
|
|
|
39
39
|
* Compute the issuer's signature over the canonical certificate
|
|
40
40
|
* bytes, then return a copy with `signature.{algorithm,key_id,value}`
|
|
41
41
|
* populated. Pre-populates the algorithm + key_id BEFORE
|
|
42
|
-
* canonicalization so the canonical bytes cover both
|
|
42
|
+
* canonicalization so the canonical bytes cover both - an attacker
|
|
43
43
|
* cannot downgrade the signing algorithm or forge a different
|
|
44
44
|
* issuer fingerprint.
|
|
45
45
|
*/
|
|
@@ -71,7 +71,7 @@ export function signDeviceCertificate(input) {
|
|
|
71
71
|
* Ed25519-verify a certificate's signature under `issuerPub`. Returns
|
|
72
72
|
* true when the signature verifies. Does NOT cross-check that the
|
|
73
73
|
* issuer is currently a registered, non-revoked full-access device
|
|
74
|
-
* for the account
|
|
74
|
+
* for the account - that requires a key directory store and is the
|
|
75
75
|
* caller's responsibility.
|
|
76
76
|
*/
|
|
77
77
|
export function verifyDeviceCertificate(certificate, issuerPub) {
|
|
@@ -259,7 +259,7 @@ function validateRateLimits(tiers, path) {
|
|
|
259
259
|
}
|
|
260
260
|
/**
|
|
261
261
|
* Report whether `matcher` permits sending to `recipient` per
|
|
262
|
-
* §10.3.3.1. Does NOT evaluate rate limits
|
|
262
|
+
* §10.3.3.1. Does NOT evaluate rate limits - the caller applies
|
|
263
263
|
* rate-limit tiers separately per §10.3.4.
|
|
264
264
|
*/
|
|
265
265
|
export function scopeAllowsRecipient(matcher, recipient) {
|
|
@@ -273,7 +273,7 @@ export function scopeAllowsRecipient(matcher, recipient) {
|
|
|
273
273
|
case "denylist":
|
|
274
274
|
return !matchAny(matcher.deny ?? [], recipient);
|
|
275
275
|
default:
|
|
276
|
-
// Unknown mode
|
|
276
|
+
// Unknown mode - fail closed.
|
|
277
277
|
return false;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Per-key revocation primitives per KEY.md §8.
|
|
3
3
|
*
|
|
4
|
-
* The published wire shape is `SEMP_KEY_REVOCATION`
|
|
4
|
+
* The published wire shape is `SEMP_KEY_REVOCATION` - a list of
|
|
5
5
|
* revoked keys signed by the publishing party (a domain or a user).
|
|
6
6
|
* The signature uses the `SEMP-REVOCATION:` domain-separation
|
|
7
7
|
* prefix per ENVELOPE.md §4.3.
|
|
@@ -23,7 +23,7 @@ export interface PublicationSignature {
|
|
|
23
23
|
value: string;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Per-key revocation record per §8.4
|
|
26
|
+
* Per-key revocation record per §8.4 - embedded in a key response
|
|
27
27
|
* or in a {@link RevocationPublication}.
|
|
28
28
|
*/
|
|
29
29
|
export interface Revocation {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Per-key revocation primitives per KEY.md §8.
|
|
3
3
|
*
|
|
4
|
-
* The published wire shape is `SEMP_KEY_REVOCATION`
|
|
4
|
+
* The published wire shape is `SEMP_KEY_REVOCATION` - a list of
|
|
5
5
|
* revoked keys signed by the publishing party (a domain or a user).
|
|
6
6
|
* The signature uses the `SEMP-REVOCATION:` domain-separation
|
|
7
7
|
* prefix per ENVELOPE.md §4.3.
|
package/dist/keys/request.d.ts
CHANGED
|
@@ -15,8 +15,22 @@ export declare const KeysRequestType = "SEMP_KEYS";
|
|
|
15
15
|
export declare const KeysRequestVersion = "1.0.0";
|
|
16
16
|
/** Step discriminator for SEMP_KEYS messages. */
|
|
17
17
|
export type KeysRequestStep = "request" | "response";
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Per-address lookup status per draft-gokce-semp-client §6.4. The
|
|
20
|
+
* set mirrors the submission-time status vocabulary so the client
|
|
21
|
+
* can share dispatch logic between key fetch and submission.
|
|
22
|
+
*
|
|
23
|
+
* - "found": the home server returned a current key set.
|
|
24
|
+
* - "not_found": the address is registered with the home server
|
|
25
|
+
* but has no current published key.
|
|
26
|
+
* - "legacy_required": the address belongs to a domain that does
|
|
27
|
+
* not run SEMP; client SHOULD fall back to legacy interop.
|
|
28
|
+
* - "recipient_not_found": no record of the address at the home
|
|
29
|
+
* server.
|
|
30
|
+
* - "error": the lookup failed for a transient or unspecified
|
|
31
|
+
* reason. `error_reason` carries the diagnostic.
|
|
32
|
+
*/
|
|
33
|
+
export type KeysResultStatus = "found" | "not_found" | "legacy_required" | "recipient_not_found" | "error";
|
|
20
34
|
/** A single key record per KEY.md §3 / §10.6. */
|
|
21
35
|
export interface KeyRecord {
|
|
22
36
|
algorithm: string;
|
|
@@ -53,7 +67,7 @@ export interface KeysRequest {
|
|
|
53
67
|
type: typeof KeysRequestType;
|
|
54
68
|
step: "request";
|
|
55
69
|
version: string;
|
|
56
|
-
/** ULID for the request
|
|
70
|
+
/** ULID for the request - used to correlate the response. */
|
|
57
71
|
id: string;
|
|
58
72
|
/** ISO 8601 UTC. */
|
|
59
73
|
timestamp: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/keys/request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qCAAqC;AACrC,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/keys/request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qCAAqC;AACrC,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,WAAW,GACX,iBAAiB,GACjB,qBAAqB,GACrB,OAAO,CAAC;AAEZ,iDAAiD;AACjD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;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AAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,iFAAiF;IACjF,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EAAE,EACnB,KAAK,GAAE,MAAM,IAAuB,GACnC,WAAW,CAgBb;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,kBAAkB,EAAE,EAC7B,KAAK,GAAE,MAAM,IAAuB,GACnC,YAAY,CAYd;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CA8B1D;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,gBAAgB,EACxB,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,YAAY,CAAC,CAuCvB"}
|
package/dist/keys/request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/keys/request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qCAAqC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAE3C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;
|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B,MAAM,KAAK,IAAI;QACf,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EACrB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,GAAG,GAAG,MAAiC,CAAC;IAC9C,IAAI,GAAG,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,uBAAuB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,eAAe,EAAE,CAC3E,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CACb,uBAAuB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CACnE,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAC/F,CAAC;IACJ,CAAC;IACD,OAAO,GAA8B,CAAC;AACxC,CAAC;AAED,SAAS,SAAS,CAAC,CAAO;IACxB,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/keys/sign.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ 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
|
|
44
|
+
* Compute the SEMP key fingerprint per `KEY.md` §3 - SHA-256 of
|
|
45
45
|
* the raw 32-byte public key, lowercase-hex encoded. Used as the
|
|
46
46
|
* `key_id` field everywhere keys are referenced.
|
|
47
47
|
*/
|
package/dist/keys/sign.js
CHANGED
|
@@ -59,7 +59,7 @@ export function verify(publicKey, signature, message) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Compute the SEMP key fingerprint per `KEY.md` §3
|
|
62
|
+
* Compute the SEMP key fingerprint per `KEY.md` §3 - SHA-256 of
|
|
63
63
|
* the raw 32-byte public key, lowercase-hex encoded. Used as the
|
|
64
64
|
* `key_id` field everywhere keys are referenced.
|
|
65
65
|
*/
|
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,W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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,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"}
|