@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/discovery/configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,iCAAiC,CAAC;AAE/D,qCAAqC;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/discovery/configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,iCAAiC,CAAC;AAE/D,qCAAqC;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,CAAC;AA2E3C;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,uBAAuB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,iBAAiB,EAAE,CAC/E,CAAC;IACJ,CAAC;IACD,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAChC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC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C,GAAG,EAAE,IAAI,GAAG,CAAC;IACzC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,4BAA4B,CAAC,CAAC;IACrE,CAAC;IACD,KAAK,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IACD,OAAO,CAAuB,CAAC;AACjC,CAAC"}
|
package/dist/discovery/dns.d.ts
CHANGED
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
14
|
import { type TXTCapabilities } from "./txt.js";
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* A parsed SEMP SRV record per §2.1. Returned by both
|
|
17
|
+
* {@link lookupSRV} (the standard `_semp._tcp.<domain>` record) and
|
|
18
|
+
* {@link lookupSRVUDP} (the optional `_semp._udp.<domain>` record
|
|
19
|
+
* that operators MAY publish to advertise a distinct QUIC target).
|
|
20
|
+
*/
|
|
16
21
|
export interface SRVRecord {
|
|
17
22
|
priority: number;
|
|
18
23
|
weight: number;
|
|
@@ -45,6 +50,27 @@ export declare function defaultDNSLookup(): Promise<DNSLookup>;
|
|
|
45
50
|
* selection per RFC 2782 sort within a priority group themselves).
|
|
46
51
|
*/
|
|
47
52
|
export declare function lookupSRV(domain: string, lookup?: DNSLookup): Promise<SRVRecord[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Look up the optional `_semp._udp.<domain>` SRV records per §2.1.
|
|
55
|
+
* Operators MAY publish this record when they want to advertise a
|
|
56
|
+
* distinct UDP target for QUIC (different host/port than the TCP
|
|
57
|
+
* target). Clients selecting QUIC MUST prefer it over the
|
|
58
|
+
* `_semp._tcp` target when present. When absent the QUIC endpoint
|
|
59
|
+
* defaults to the `_semp._tcp` target's host:port, which is the
|
|
60
|
+
* common case.
|
|
61
|
+
*
|
|
62
|
+
* Returns an empty array when no `_udp` record is published.
|
|
63
|
+
*/
|
|
64
|
+
export declare function lookupSRVUDP(domain: string, lookup?: DNSLookup): Promise<SRVRecord[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve the SRV record a QUIC-capable client should use for
|
|
67
|
+
* `domain`. Prefers the optional `_semp._udp` record when present
|
|
68
|
+
* (operator-specified distinct UDP target). Otherwise falls back to
|
|
69
|
+
* the `_semp._tcp` target's host:port per DISCOVERY.md §2.1.
|
|
70
|
+
*
|
|
71
|
+
* Returns null when neither record exists.
|
|
72
|
+
*/
|
|
73
|
+
export declare function quicTarget(domain: string, lookup?: DNSLookup): Promise<SRVRecord | null>;
|
|
48
74
|
/**
|
|
49
75
|
* Look up `_semp._tcp.<domain>` TXT records and return the first
|
|
50
76
|
* one whose `v=` parameter is `semp1`. Returns null when no SEMP
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../src/discovery/dns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,UAAU,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../src/discovery/dns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,UAAU,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,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ain, lookup) {
|
|
|
95
95
|
const recs = await dns.lookupSRV(name);
|
|
96
96
|
return [...recs].sort((a, b) => a.priority - b.priority);
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Look up the optional `_semp._udp.<domain>` SRV records per §2.1.
|
|
100
|
+
* Operators MAY publish this record when they want to advertise a
|
|
101
|
+
* distinct UDP target for QUIC (different host/port than the TCP
|
|
102
|
+
* target). Clients selecting QUIC MUST prefer it over the
|
|
103
|
+
* `_semp._tcp` target when present. When absent the QUIC endpoint
|
|
104
|
+
* defaults to the `_semp._tcp` target's host:port, which is the
|
|
105
|
+
* common case.
|
|
106
|
+
*
|
|
107
|
+
* Returns an empty array when no `_udp` record is published.
|
|
108
|
+
*/
|
|
109
|
+
export async function lookupSRVUDP(domain, lookup) {
|
|
110
|
+
const dns = lookup ?? (await defaultDNSLookup());
|
|
111
|
+
const name = `_semp._udp.${domain}`;
|
|
112
|
+
const recs = await dns.lookupSRV(name);
|
|
113
|
+
return [...recs].sort((a, b) => a.priority - b.priority);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Resolve the SRV record a QUIC-capable client should use for
|
|
117
|
+
* `domain`. Prefers the optional `_semp._udp` record when present
|
|
118
|
+
* (operator-specified distinct UDP target). Otherwise falls back to
|
|
119
|
+
* the `_semp._tcp` target's host:port per DISCOVERY.md §2.1.
|
|
120
|
+
*
|
|
121
|
+
* Returns null when neither record exists.
|
|
122
|
+
*/
|
|
123
|
+
export async function quicTarget(domain, lookup) {
|
|
124
|
+
const dns = lookup ?? (await defaultDNSLookup());
|
|
125
|
+
const udp = await lookupSRVUDP(domain, dns);
|
|
126
|
+
if (udp.length > 0) {
|
|
127
|
+
return udp[0] ?? null;
|
|
128
|
+
}
|
|
129
|
+
const tcp = await lookupSRV(domain, dns);
|
|
130
|
+
if (tcp.length > 0) {
|
|
131
|
+
return tcp[0] ?? null;
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
98
135
|
/**
|
|
99
136
|
* Look up `_semp._tcp.<domain>` TXT records and return the first
|
|
100
137
|
* one whose `v=` parameter is `semp1`. Returns null when no SEMP
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dns.js","sourceRoot":"","sources":["../../src/discovery/dns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAwB,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"dns.js","sourceRoot":"","sources":["../../src/discovery/dns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAwB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAgCtE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,GAAuC,CAAC;IAC5C,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,CAAC,SAAS,CAAC,MAAc;YAC5B,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;oBACpB,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;iBAClC,CAAC,CAAC,CAAC;YACN,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACrC,O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M,IAAI,CAAC,MAAM,gBAAgB,EAAE,CAAC,CAAC;IACjD,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
export { parseTXTCapabilities, type TXTCapabilities } from "./txt.js";
|
|
11
|
-
export { type ConfigEndpoints, type ConfigExtension, type ConfigLimits, type Configuration, type TransportEndpoints, ConfigurationType, WellKnownMaxBytes, WellKnownPath, parseConfiguration, } from "./configuration.js";
|
|
11
|
+
export { type ConfigEndpoints, type ConfigExtension, type ConfigLimits, type Configuration, type ReciprocityMode, type ReciprocityPolicy, type TransportEndpoints, ConfigurationType, WellKnownMaxBytes, WellKnownPath, parseConfiguration, } from "./configuration.js";
|
|
12
12
|
export { type DomainKeys, type KeyBlock, DomainKeysMaxBytes, DomainKeysType, decodeKeyBlockPublic, parseDomainKeys, verifyDomainKeyFingerprint, } from "./domain_keys.js";
|
|
13
13
|
export { type FetchLike, type FetchOptions, type ResolveServerOptions, type ResolvedServer, fetchConfiguration, fetchDomainKeys, resolveServer, wellKnownUrl, } from "./resolver.js";
|
|
14
|
-
export { type DNSLookup, type MXRecord, type SRVRecord, defaultDNSLookup, lookupMX, lookupSRV, lookupTXT, } from "./dns.js";
|
|
14
|
+
export { type DNSLookup, type MXRecord, type SRVRecord, defaultDNSLookup, lookupMX, lookupSRV, lookupSRVUDP, lookupTXT, quicTarget, } from "./dns.js";
|
|
15
15
|
export { type DiscoveryCache, DefaultTTLLegacyMs, DefaultTTLNotFoundMs, DefaultTTLSEMPMs, InMemoryDiscoveryCache, } from "./cache.js";
|
|
16
16
|
export { type DiscoveryRequest, type DiscoveryResponse, type DiscoveryResult, type DiscoverySignature, type DiscoveryStatus, DiscoveryMessageType, DiscoveryRecordVersion, DiscoverySignaturePrefix, DiscoveryStepRequest, DiscoveryStepResponse, signDiscoveryResponse, validateDiscoveryRequest, validateDiscoveryResponse, verifyDiscoveryResponse, } from "./lookup.js";
|
|
17
17
|
export { OnionSuffix, OnionV3LabelLength, isOnionDomain, validateOnionDomain, } from "./onion.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,SAAS,EACT,UAAU,GACX,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,cAAc,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
|
package/dist/discovery/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { parseTXTCapabilities } from "./txt.js";
|
|
|
11
11
|
export { ConfigurationType, WellKnownMaxBytes, WellKnownPath, parseConfiguration, } from "./configuration.js";
|
|
12
12
|
export { DomainKeysMaxBytes, DomainKeysType, decodeKeyBlockPublic, parseDomainKeys, verifyDomainKeyFingerprint, } from "./domain_keys.js";
|
|
13
13
|
export { fetchConfiguration, fetchDomainKeys, resolveServer, wellKnownUrl, } from "./resolver.js";
|
|
14
|
-
export { defaultDNSLookup, lookupMX, lookupSRV, lookupTXT, } from "./dns.js";
|
|
14
|
+
export { defaultDNSLookup, lookupMX, lookupSRV, lookupSRVUDP, lookupTXT, quicTarget, } from "./dns.js";
|
|
15
15
|
export { DefaultTTLLegacyMs, DefaultTTLNotFoundMs, DefaultTTLSEMPMs, InMemoryDiscoveryCache, } from "./cache.js";
|
|
16
16
|
export { DiscoveryMessageType, DiscoveryRecordVersion, DiscoverySignaturePrefix, DiscoveryStepRequest, DiscoveryStepResponse, signDiscoveryResponse, validateDiscoveryRequest, validateDiscoveryResponse, verifyDiscoveryResponse, } from "./lookup.js";
|
|
17
17
|
export { OnionSuffix, OnionV3LabelLength, isOnionDomain, validateOnionDomain, } from "./onion.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAwB,MAAM,UAAU,CAAC;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/discovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAwB,MAAM,UAAU,CAAC;AAEtE,OAAO,EAQL,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAGL,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAKL,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAIL,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,SAAS,EACT,UAAU,GACX,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAML,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAML,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
|
|
@@ -50,7 +50,7 @@ export declare function defaultAlphaRanges(servers: number): AlphaRange[];
|
|
|
50
50
|
* lookup server (published at `_semp-partition-lookup.<domain>` SRV)
|
|
51
51
|
* and returns the hostname of the delivery server that handles
|
|
52
52
|
* `address`. The discovery package does not prescribe the wire
|
|
53
|
-
* format of the lookup query
|
|
53
|
+
* format of the lookup query - DISCOVERY.md §2.4 says "the
|
|
54
54
|
* partition server address is published as a separate SRV record"
|
|
55
55
|
* and leaves the query protocol to the implementation.
|
|
56
56
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Discovery resolver
|
|
2
|
+
* Discovery resolver - well-known URI fetch + parse, plus the
|
|
3
3
|
* higher-level "resolve a server" orchestrator that produces the
|
|
4
4
|
* `serverDomainPub` a {@link "../handshake/driver".runClient} call
|
|
5
5
|
* needs.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* the resolver uses Node 22+'s global `fetch`.
|
|
10
10
|
*
|
|
11
11
|
* The DNS SRV / TXT lookup leg of §5.1 is intentionally not
|
|
12
|
-
* implemented in this module
|
|
12
|
+
* implemented in this module - it requires `node:dns/promises` and
|
|
13
13
|
* does not cleanly tree-shake into a browser bundle. Callers that
|
|
14
14
|
* need DNS-first discovery wire it in front of {@link resolveServer}
|
|
15
15
|
* and pass an explicit `host` / well-known URL.
|
|
@@ -42,7 +42,7 @@ export interface FetchOptions {
|
|
|
42
42
|
/** Optional cancellation signal. */
|
|
43
43
|
signal?: AbortSignal;
|
|
44
44
|
/**
|
|
45
|
-
* Per-request timeout in milliseconds. Defaults to 10 seconds
|
|
45
|
+
* Per-request timeout in milliseconds. Defaults to 10 seconds -
|
|
46
46
|
* matches semp-go's `FetchConfiguration` default.
|
|
47
47
|
*/
|
|
48
48
|
timeoutMs?: number;
|
|
@@ -54,7 +54,7 @@ export declare function wellKnownUrl(host: string): string;
|
|
|
54
54
|
* Throws on transport failure, non-200 status, oversized body, or
|
|
55
55
|
* structural parse failure.
|
|
56
56
|
*
|
|
57
|
-
* The URL's scheme is NOT enforced
|
|
57
|
+
* The URL's scheme is NOT enforced - production callers must pass an
|
|
58
58
|
* `https://` URL, but tests need to point at a local httptest-style
|
|
59
59
|
* server so this layer stays permissive.
|
|
60
60
|
*/
|
|
@@ -64,7 +64,7 @@ export declare function fetchConfiguration(url: string, opts?: FetchOptions): Pr
|
|
|
64
64
|
* `endpoints.domain_keys` in a server's configuration. Returns the
|
|
65
65
|
* parsed document and the cross-checked signing-key public bytes.
|
|
66
66
|
*
|
|
67
|
-
* Throws if the fingerprint cross-check fails
|
|
67
|
+
* Throws if the fingerprint cross-check fails - a peer that trusts
|
|
68
68
|
* the publication channel still MUST confirm `key_id` is the SHA-256
|
|
69
69
|
* fingerprint of `public_key`, otherwise a misconfiguration could
|
|
70
70
|
* swap in a key whose fingerprint doesn't match the one the peer
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Discovery resolver
|
|
2
|
+
* Discovery resolver - well-known URI fetch + parse, plus the
|
|
3
3
|
* higher-level "resolve a server" orchestrator that produces the
|
|
4
4
|
* `serverDomainPub` a {@link "../handshake/driver".runClient} call
|
|
5
5
|
* needs.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* the resolver uses Node 22+'s global `fetch`.
|
|
10
10
|
*
|
|
11
11
|
* The DNS SRV / TXT lookup leg of §5.1 is intentionally not
|
|
12
|
-
* implemented in this module
|
|
12
|
+
* implemented in this module - it requires `node:dns/promises` and
|
|
13
13
|
* does not cleanly tree-shake into a browser bundle. Callers that
|
|
14
14
|
* need DNS-first discovery wire it in front of {@link resolveServer}
|
|
15
15
|
* and pass an explicit `host` / well-known URL.
|
|
@@ -30,7 +30,7 @@ export function wellKnownUrl(host) {
|
|
|
30
30
|
* Throws on transport failure, non-200 status, oversized body, or
|
|
31
31
|
* structural parse failure.
|
|
32
32
|
*
|
|
33
|
-
* The URL's scheme is NOT enforced
|
|
33
|
+
* The URL's scheme is NOT enforced - production callers must pass an
|
|
34
34
|
* `https://` URL, but tests need to point at a local httptest-style
|
|
35
35
|
* server so this layer stays permissive.
|
|
36
36
|
*/
|
|
@@ -50,7 +50,7 @@ export async function fetchConfiguration(url, opts = {}) {
|
|
|
50
50
|
* `endpoints.domain_keys` in a server's configuration. Returns the
|
|
51
51
|
* parsed document and the cross-checked signing-key public bytes.
|
|
52
52
|
*
|
|
53
|
-
* Throws if the fingerprint cross-check fails
|
|
53
|
+
* Throws if the fingerprint cross-check fails - a peer that trusts
|
|
54
54
|
* the publication channel still MUST confirm `key_id` is the SHA-256
|
|
55
55
|
* fingerprint of `public_key`, otherwise a misconfiguration could
|
|
56
56
|
* swap in a key whose fingerprint doesn't match the one the peer
|
|
@@ -144,7 +144,7 @@ async function fetchTextBounded(url, maxBytes, opts) {
|
|
|
144
144
|
if (!resp.ok) {
|
|
145
145
|
throw new Error(`discovery: GET ${url} returned ${resp.status}`);
|
|
146
146
|
}
|
|
147
|
-
// Permissive content-type check
|
|
147
|
+
// Permissive content-type check - some servers return
|
|
148
148
|
// application/octet-stream for .json paths. We require JSON in the
|
|
149
149
|
// body parse, not in the header.
|
|
150
150
|
const ct = resp.headers.get("content-type") ?? "";
|
package/dist/discovery/txt.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - `c` list comma-separated transport identifiers
|
|
15
15
|
* - `f` list comma-separated optional features
|
|
16
16
|
*
|
|
17
|
-
* Unknown keys MUST be ignored, not rejected
|
|
17
|
+
* Unknown keys MUST be ignored, not rejected - DNS TXT records are
|
|
18
18
|
* a public surface and an upgrading peer might add new keys before
|
|
19
19
|
* a downgrading peer learns about them.
|
|
20
20
|
*
|
package/dist/discovery/txt.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - `c` list comma-separated transport identifiers
|
|
15
15
|
* - `f` list comma-separated optional features
|
|
16
16
|
*
|
|
17
|
-
* Unknown keys MUST be ignored, not rejected
|
|
17
|
+
* Unknown keys MUST be ignored, not rejected - DNS TXT records are
|
|
18
18
|
* a public surface and an upgrading peer might add new keys before
|
|
19
19
|
* a downgrading peer learns about them.
|
|
20
20
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Signed scope: the `original_enclosure_plaintext` subtree.
|
|
10
10
|
*
|
|
11
11
|
* 2. The FORWARDER's `forwarder_attestation` over the
|
|
12
|
-
* `forwarded_from` block
|
|
12
|
+
* `forwarded_from` block - the inner sender_signature is
|
|
13
13
|
* already populated by step 1, so this signs over canonical
|
|
14
14
|
* bytes that include it. Prefix: `SEMP-FORWARDER-ATTESTATION:`.
|
|
15
15
|
* Signed scope: the entire `forwarded_from` subtree.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Signed scope: the `original_enclosure_plaintext` subtree.
|
|
10
10
|
*
|
|
11
11
|
* 2. The FORWARDER's `forwarder_attestation` over the
|
|
12
|
-
* `forwarded_from` block
|
|
12
|
+
* `forwarded_from` block - the inner sender_signature is
|
|
13
13
|
* already populated by step 1, so this signs over canonical
|
|
14
14
|
* bytes that include it. Prefix: `SEMP-FORWARDER-ATTESTATION:`.
|
|
15
15
|
* Signed scope: the entire `forwarded_from` subtree.
|
|
@@ -20,7 +20,7 @@ export declare const DefaultMaxEnvelopeSize: number;
|
|
|
20
20
|
* Select the size bucket for an unpadded envelope of the given byte
|
|
21
21
|
* size per the default power-of-two curve (4096, 8192, 16384, ...).
|
|
22
22
|
*
|
|
23
|
-
* Throws on negative input or input that exceeds the ceiling
|
|
23
|
+
* Throws on negative input or input that exceeds the ceiling - over-
|
|
24
24
|
* limit envelopes MUST be recomposed; padding is not a remedy for
|
|
25
25
|
* over-limit content.
|
|
26
26
|
*/
|
|
@@ -31,7 +31,7 @@ export declare function selectSizeBucket(unpaddedSize: number, maxEnvelopeSize?:
|
|
|
31
31
|
* in which case the floor relaxes to 1 (a single-domain non-group
|
|
32
32
|
* send reveals only the obvious cardinality and gains no
|
|
33
33
|
* obfuscation from padding to 2). Real counts above 1024 force
|
|
34
|
-
* recomposition into multiple envelopes
|
|
34
|
+
* recomposition into multiple envelopes - the runner returns a
|
|
35
35
|
* sentinel of -1 in that case so callers can detect it.
|
|
36
36
|
*/
|
|
37
37
|
export declare function selectRecipientCountBucket(realRecipients: number, singleDomainNotGroup: boolean): number;
|
package/dist/envelope/buckets.js
CHANGED
|
@@ -20,7 +20,7 @@ export const DefaultMaxEnvelopeSize = 25 * 1024 * 1024;
|
|
|
20
20
|
* Select the size bucket for an unpadded envelope of the given byte
|
|
21
21
|
* size per the default power-of-two curve (4096, 8192, 16384, ...).
|
|
22
22
|
*
|
|
23
|
-
* Throws on negative input or input that exceeds the ceiling
|
|
23
|
+
* Throws on negative input or input that exceeds the ceiling - over-
|
|
24
24
|
* limit envelopes MUST be recomposed; padding is not a remedy for
|
|
25
25
|
* over-limit content.
|
|
26
26
|
*/
|
|
@@ -51,7 +51,7 @@ export function selectSizeBucket(unpaddedSize, maxEnvelopeSize) {
|
|
|
51
51
|
* in which case the floor relaxes to 1 (a single-domain non-group
|
|
52
52
|
* send reveals only the obvious cardinality and gains no
|
|
53
53
|
* obfuscation from padding to 2). Real counts above 1024 force
|
|
54
|
-
* recomposition into multiple envelopes
|
|
54
|
+
* recomposition into multiple envelopes - the runner returns a
|
|
55
55
|
* sentinel of -1 in that case so callers can detect it.
|
|
56
56
|
*/
|
|
57
57
|
export function selectRecipientCountBucket(realRecipients, singleDomainNotGroup) {
|
|
@@ -130,7 +130,7 @@ export interface Envelope {
|
|
|
130
130
|
*/
|
|
131
131
|
export declare function compose(input: ComposeInput): Envelope;
|
|
132
132
|
/**
|
|
133
|
-
* Compute the §4.3 canonical envelope bytes
|
|
133
|
+
* Compute the §4.3 canonical envelope bytes - signature and
|
|
134
134
|
* session_mac blanked, hop_count and padding omitted.
|
|
135
135
|
*/
|
|
136
136
|
export declare function canonicalEnvelopeFor(envelope: unknown): Uint8Array;
|
|
@@ -162,10 +162,25 @@ export interface OpenedEnvelope {
|
|
|
162
162
|
* returns the parsed plaintexts. Throws if the recipient slot is
|
|
163
163
|
* absent or the AEAD tag does not verify.
|
|
164
164
|
*
|
|
165
|
-
* Does NOT verify seal.signature or seal.session_mac
|
|
165
|
+
* Does NOT verify seal.signature or seal.session_mac - those are
|
|
166
166
|
* the routing-server / receiving-server checks per §7.2 and live
|
|
167
167
|
* on the server side. {@link verifySealSignature} and
|
|
168
168
|
* {@link verifySessionMAC} are the corresponding verifier helpers.
|
|
169
169
|
*/
|
|
170
170
|
export declare function openForRecipient(input: OpenInput): OpenedEnvelope;
|
|
171
|
+
/**
|
|
172
|
+
* Open just the brief slot for a specific recipient. Servers (which
|
|
173
|
+
* sit in `brief_recipients` for routing but NOT in `enclosure_recipients`)
|
|
174
|
+
* use this; clients that hold both slots use {@link openForRecipient}.
|
|
175
|
+
*
|
|
176
|
+
* Throws if the recipient is absent from `brief_recipients` or the
|
|
177
|
+
* AEAD tag does not verify.
|
|
178
|
+
*/
|
|
179
|
+
export declare function openBriefForRecipient(input: OpenInput): unknown;
|
|
180
|
+
/**
|
|
181
|
+
* Open just the enclosure slot for a specific recipient. Mirror of
|
|
182
|
+
* {@link openBriefForRecipient}. Throws if the recipient is absent
|
|
183
|
+
* from `enclosure_recipients` or the AEAD tag does not verify.
|
|
184
|
+
*/
|
|
185
|
+
export declare function openEnclosureForRecipient(input: OpenInput): unknown;
|
|
171
186
|
//# sourceMappingURL=compose.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/envelope/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAaH,OAAO,EACL,KAAK,KAAK,EACV,KAAK,cAAc,EAGpB,MAAM,kBAAkB,CAAC;AAK1B;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,sCAAsC;AACtC,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,uBAAuB,EAAE,UAAU,CAAC;IACpC,uBAAuB;IACvB,QAAQ,EAAE,cAAc,CAAC;IACzB,+DAA+D;IAC/D,cAAc,EAAE,OAAO,CAAC;IACxB,yFAAyF;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,eAAe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AAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtC,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAUD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,CAuGrD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,CAoBlE;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,mBAAmB,EAAE,UAAU,CAAC;IAChC,gEAAgE;IAChE,kBAAkB,EAAE,UAAU,CAAC;CAChC;AAED,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;IACf,sDAAsD;IACtD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,CAIjE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CA0B/D;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CA0BnE"}
|
package/dist/envelope/compose.js
CHANGED
|
@@ -89,10 +89,10 @@ export function compose(input) {
|
|
|
89
89
|
//
|
|
90
90
|
// Wire-shape rules:
|
|
91
91
|
// postmark.extensions and seal.extensions DEFAULT to {} when
|
|
92
|
-
// the caller doesn't pass them
|
|
92
|
+
// the caller doesn't pass them - these slots are always
|
|
93
93
|
// present on the wire (some routers depend on the keys
|
|
94
94
|
// existing as a marker even when empty).
|
|
95
|
-
// Top-level extensions DEFAULTS to absent
|
|
95
|
+
// Top-level extensions DEFAULTS to absent - the spec treats
|
|
96
96
|
// it as truly optional.
|
|
97
97
|
const postmark = {
|
|
98
98
|
...input.postmark,
|
|
@@ -131,7 +131,7 @@ export function compose(input) {
|
|
|
131
131
|
return env;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
* Compute the §4.3 canonical envelope bytes
|
|
134
|
+
* Compute the §4.3 canonical envelope bytes - signature and
|
|
135
135
|
* session_mac blanked, hop_count and padding omitted.
|
|
136
136
|
*/
|
|
137
137
|
export function canonicalEnvelopeFor(envelope) {
|
|
@@ -161,22 +161,33 @@ export function canonicalEnvelopeFor(envelope) {
|
|
|
161
161
|
* returns the parsed plaintexts. Throws if the recipient slot is
|
|
162
162
|
* absent or the AEAD tag does not verify.
|
|
163
163
|
*
|
|
164
|
-
* Does NOT verify seal.signature or seal.session_mac
|
|
164
|
+
* Does NOT verify seal.signature or seal.session_mac - those are
|
|
165
165
|
* the routing-server / receiving-server checks per §7.2 and live
|
|
166
166
|
* on the server side. {@link verifySealSignature} and
|
|
167
167
|
* {@link verifySessionMAC} are the corresponding verifier helpers.
|
|
168
168
|
*/
|
|
169
169
|
export function openForRecipient(input) {
|
|
170
|
+
const brief = openBriefForRecipient(input);
|
|
171
|
+
const enclosure = openEnclosureForRecipient(input);
|
|
172
|
+
return { brief, enclosure };
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Open just the brief slot for a specific recipient. Servers (which
|
|
176
|
+
* sit in `brief_recipients` for routing but NOT in `enclosure_recipients`)
|
|
177
|
+
* use this; clients that hold both slots use {@link openForRecipient}.
|
|
178
|
+
*
|
|
179
|
+
* Throws if the recipient is absent from `brief_recipients` or the
|
|
180
|
+
* AEAD tag does not verify.
|
|
181
|
+
*/
|
|
182
|
+
export function openBriefForRecipient(input) {
|
|
170
183
|
const aead = suiteBriefEnclosureAEAD(input.suite);
|
|
171
184
|
const env = input.envelope;
|
|
172
185
|
const postmarkID = new TextEncoder().encode(env.postmark.id);
|
|
173
|
-
// Unwrap K_brief.
|
|
174
186
|
const briefWrapped = env.seal.brief_recipients[input.recipientKeyId];
|
|
175
187
|
if (typeof briefWrapped !== "string") {
|
|
176
188
|
throw new Error(`open: recipient ${input.recipientKeyId} not in brief_recipients`);
|
|
177
189
|
}
|
|
178
190
|
const kBrief = sealUnwrap(input.suite, input.recipientPrivateKey, input.recipientPublicKey, briefWrapped);
|
|
179
|
-
// Brief AEAD: blob is base64(nonce || aead_ct), 12-byte nonce.
|
|
180
191
|
const briefBlob = base64Decode(env.brief);
|
|
181
192
|
if (briefBlob.length < 12) {
|
|
182
193
|
throw new Error("open: brief blob too short");
|
|
@@ -184,14 +195,22 @@ export function openForRecipient(input) {
|
|
|
184
195
|
const briefNonce = briefBlob.slice(0, 12);
|
|
185
196
|
const briefCT = briefBlob.slice(12);
|
|
186
197
|
const briefPT = aeadOpen(aead, kBrief, briefNonce, briefCT, postmarkID);
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
return JSON.parse(new TextDecoder().decode(briefPT));
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Open just the enclosure slot for a specific recipient. Mirror of
|
|
202
|
+
* {@link openBriefForRecipient}. Throws if the recipient is absent
|
|
203
|
+
* from `enclosure_recipients` or the AEAD tag does not verify.
|
|
204
|
+
*/
|
|
205
|
+
export function openEnclosureForRecipient(input) {
|
|
206
|
+
const aead = suiteBriefEnclosureAEAD(input.suite);
|
|
207
|
+
const env = input.envelope;
|
|
208
|
+
const postmarkID = new TextEncoder().encode(env.postmark.id);
|
|
189
209
|
const enclosureWrapped = env.seal.enclosure_recipients[input.recipientKeyId];
|
|
190
210
|
if (typeof enclosureWrapped !== "string") {
|
|
191
211
|
throw new Error(`open: recipient ${input.recipientKeyId} not in enclosure_recipients`);
|
|
192
212
|
}
|
|
193
213
|
const kEnclosure = sealUnwrap(input.suite, input.recipientPrivateKey, input.recipientPublicKey, enclosureWrapped);
|
|
194
|
-
// Enclosure AEAD: same wire shape.
|
|
195
214
|
const enclBlob = base64Decode(env.enclosure);
|
|
196
215
|
if (enclBlob.length < 12) {
|
|
197
216
|
throw new Error("open: enclosure blob too short");
|
|
@@ -199,8 +218,7 @@ export function openForRecipient(input) {
|
|
|
199
218
|
const enclNonce = enclBlob.slice(0, 12);
|
|
200
219
|
const enclCT = enclBlob.slice(12);
|
|
201
220
|
const enclPT = aeadOpen(aead, kEnclosure, enclNonce, enclCT, postmarkID);
|
|
202
|
-
|
|
203
|
-
return { brief, enclosure };
|
|
221
|
+
return JSON.parse(new TextDecoder().decode(enclPT));
|
|
204
222
|
}
|
|
205
223
|
// ---------------------------------------------------------------------------
|
|
206
224
|
// Helpers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/envelope/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAEL,QAAQ,EACR,QAAQ,EACR,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAGL,MAAM,IAAI,UAAU,EACpB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,qEAAqE;AACrE,MAAM,cAAc,GAAG,gBAAgB,CAAC;AA2FxC,uEAAuE;AACvE,SAAS,uBAAuB,CAAC,KAAY;IAC3C,gEAAgE;IAChE,gEAAgE;IAChE,KAAK,KAAK,CAAC;IACX,OAAO,mBAAmB,CAAC;AAC7B,CA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,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (`Content-Type: application/semp-envelope`) and for storage as a
|
|
7
7
|
* `.semp` file.
|
|
8
8
|
*
|
|
9
|
-
* `encodeEnvelope` does NOT produce the canonical form
|
|
9
|
+
* `encodeEnvelope` does NOT produce the canonical form - use
|
|
10
10
|
* {@link "./canonical".canonicalEnvelopeBytes} for the byte stream
|
|
11
11
|
* consumed by signature and MAC computation.
|
|
12
12
|
*
|
|
@@ -19,7 +19,7 @@ export declare const EnvelopeMIMEType = "application/semp-envelope";
|
|
|
19
19
|
export declare const EnvelopeFileExtension = ".semp";
|
|
20
20
|
/**
|
|
21
21
|
* Wire JSON serialization of `env`. UTF-8, no BOM, no trailing
|
|
22
|
-
* newline
|
|
22
|
+
* newline - the byte sequence is suitable for transport bodies and
|
|
23
23
|
* for direct `.semp` file content.
|
|
24
24
|
*/
|
|
25
25
|
export declare function encodeEnvelope(env: Envelope): Uint8Array;
|
package/dist/envelope/encode.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (`Content-Type: application/semp-envelope`) and for storage as a
|
|
7
7
|
* `.semp` file.
|
|
8
8
|
*
|
|
9
|
-
* `encodeEnvelope` does NOT produce the canonical form
|
|
9
|
+
* `encodeEnvelope` does NOT produce the canonical form - use
|
|
10
10
|
* {@link "./canonical".canonicalEnvelopeBytes} for the byte stream
|
|
11
11
|
* consumed by signature and MAC computation.
|
|
12
12
|
*
|
|
@@ -18,11 +18,11 @@ export const EnvelopeMIMEType = "application/semp-envelope";
|
|
|
18
18
|
export const EnvelopeFileExtension = ".semp";
|
|
19
19
|
/**
|
|
20
20
|
* Wire JSON serialization of `env`. UTF-8, no BOM, no trailing
|
|
21
|
-
* newline
|
|
21
|
+
* newline - the byte sequence is suitable for transport bodies and
|
|
22
22
|
* for direct `.semp` file content.
|
|
23
23
|
*/
|
|
24
24
|
export function encodeEnvelope(env) {
|
|
25
|
-
// Plain JSON
|
|
25
|
+
// Plain JSON - NOT canonical. Used for transport, not signing.
|
|
26
26
|
return new TextEncoder().encode(JSON.stringify(env));
|
|
27
27
|
}
|
|
28
28
|
/**
|
package/dist/envelope/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { canonicalEnvelopeBytes } from "./canonical.js";
|
|
11
11
|
export { DefaultMaxEnvelopeSize, MinEnvelopeSizeBucket, selectRecipientCountBucket, selectSizeBucket, } from "./buckets.js";
|
|
12
|
-
export { type ComposeInput, type Envelope, type OpenedEnvelope, type OpenInput, type PostmarkFields, type RecipientKey, canonicalEnvelopeFor, compose, openForRecipient, } from "./compose.js";
|
|
12
|
+
export { type ComposeInput, type Envelope, type OpenedEnvelope, type OpenInput, type PostmarkFields, type RecipientKey, canonicalEnvelopeFor, compose, openBriefForRecipient, openEnclosureForRecipient, openForRecipient, } from "./compose.js";
|
|
13
13
|
export { EnvelopeFileExtension, EnvelopeMIMEType, decodeEnvelope, decodeEnvelopeFile, encodeEnvelope, encodeEnvelopeFile, } from "./encode.js";
|
|
14
14
|
export { verifySealSignature, verifySessionMAC } from "./verify.js";
|
|
15
15
|
export { type OpenedBrief, type OpenedEnclosure, type RecipientCandidate, openBriefAny, openEnclosureAny, } from "./open_any.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/envelope/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,oBAAoB,EACpB,OAAO,EACP,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,YAAY,EACZ,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,SAAS,EACd,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,mBAAmB,EACxB,6BAA6B,EAC7B,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/envelope/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,oBAAoB,EACpB,OAAO,EACP,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,YAAY,EACZ,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,SAAS,EACd,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,mBAAmB,EACxB,6BAA6B,EAC7B,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/envelope/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { canonicalEnvelopeBytes } from "./canonical.js";
|
|
11
11
|
export { DefaultMaxEnvelopeSize, MinEnvelopeSizeBucket, selectRecipientCountBucket, selectSizeBucket, } from "./buckets.js";
|
|
12
|
-
export { canonicalEnvelopeFor, compose, openForRecipient, } from "./compose.js";
|
|
12
|
+
export { canonicalEnvelopeFor, compose, openBriefForRecipient, openEnclosureForRecipient, openForRecipient, } from "./compose.js";
|
|
13
13
|
export { EnvelopeFileExtension, EnvelopeMIMEType, decodeEnvelope, decodeEnvelopeFile, encodeEnvelope, encodeEnvelopeFile, } from "./encode.js";
|
|
14
14
|
export { verifySealSignature, verifySessionMAC } from "./verify.js";
|
|
15
15
|
export { openBriefAny, openEnclosureAny, } from "./open_any.js";
|