@open-e2ee/signal-protocol-sdk 13.5.1 → 14.0.0
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/CHANGELOG.md +329 -0
- package/README.md +2 -2
- package/SECURITY.md +2 -2
- package/device/README.md +4 -3
- package/dist/client/client.d.ts +20 -55
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +133 -165
- package/dist/client/client.js.map +1 -1
- package/dist/client/content-adapter.d.ts +35 -6
- package/dist/client/content-adapter.d.ts.map +1 -1
- package/dist/client/content-adapter.js +28 -0
- package/dist/client/content-adapter.js.map +1 -1
- package/dist/client/event-hooks.d.ts +22 -11
- package/dist/client/event-hooks.d.ts.map +1 -1
- package/dist/client/event-hooks.js.map +1 -1
- package/dist/client/group-fetcher.d.ts.map +1 -1
- package/dist/client/group-fetcher.js +43 -0
- package/dist/client/group-fetcher.js.map +1 -1
- package/dist/client/group-key-sync.d.ts +65 -0
- package/dist/client/group-key-sync.d.ts.map +1 -0
- package/dist/client/group-key-sync.js +286 -0
- package/dist/client/group-key-sync.js.map +1 -0
- package/dist/client/group-outbox.d.ts +20 -6
- package/dist/client/group-outbox.d.ts.map +1 -1
- package/dist/client/group-outbox.js +153 -80
- package/dist/client/group-outbox.js.map +1 -1
- package/dist/client/group-receive-authorization.d.ts +16 -9
- package/dist/client/group-receive-authorization.d.ts.map +1 -1
- package/dist/client/group-receive-authorization.js +25 -16
- package/dist/client/group-receive-authorization.js.map +1 -1
- package/dist/client/hosted.d.ts +7 -7
- package/dist/client/hosted.js +7 -7
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/receive-queue.d.ts +3 -4
- package/dist/client/receive-queue.d.ts.map +1 -1
- package/dist/client/receive-queue.js +24 -32
- package/dist/client/receive-queue.js.map +1 -1
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +4 -9
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/retry-request-envelope.d.ts +4 -2
- package/dist/client/retry-request-envelope.d.ts.map +1 -1
- package/dist/client/retry-request-envelope.js +6 -4
- package/dist/client/retry-request-envelope.js.map +1 -1
- package/dist/client/retry-request-lifecycle.d.ts +7 -8
- package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
- package/dist/client/retry-request-lifecycle.js +10 -7
- package/dist/client/retry-request-lifecycle.js.map +1 -1
- package/dist/client/retry-terminal-recovery.d.ts +14 -15
- package/dist/client/retry-terminal-recovery.d.ts.map +1 -1
- package/dist/client/retry-terminal-recovery.js +16 -17
- package/dist/client/retry-terminal-recovery.js.map +1 -1
- package/dist/client/retry-utils.d.ts +22 -0
- package/dist/client/retry-utils.d.ts.map +1 -1
- package/dist/client/retry-utils.js +30 -0
- package/dist/client/retry-utils.js.map +1 -1
- package/dist/client/send-deadline.js +1 -1
- package/dist/client/send-deadline.js.map +1 -1
- package/dist/client/send-timestamp.d.ts +71 -14
- package/dist/client/send-timestamp.d.ts.map +1 -1
- package/dist/client/send-timestamp.js +87 -19
- package/dist/client/send-timestamp.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +125 -13
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +413 -102
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/types.d.ts +21 -16
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/groups/key-sync-ledger.d.ts +65 -0
- package/dist/internal/groups/key-sync-ledger.d.ts.map +1 -0
- package/dist/internal/groups/key-sync-ledger.js +104 -0
- package/dist/internal/groups/key-sync-ledger.js.map +1 -0
- package/dist/internal/groups/receive-record.d.ts +4 -1
- package/dist/internal/groups/receive-record.d.ts.map +1 -1
- package/dist/internal/groups/receive-record.js.map +1 -1
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js +14 -0
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/local/store/conformance/cases/durability.d.ts.map +1 -1
- package/dist/local/store/conformance/cases/durability.js +6 -0
- package/dist/local/store/conformance/cases/durability.js.map +1 -1
- package/dist/local/store/conformance/records.d.ts.map +1 -1
- package/dist/local/store/conformance/records.js +3 -0
- package/dist/local/store/conformance/records.js.map +1 -1
- package/dist/local/store/expo/adapter.js +2 -2
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/key-value/adapter.d.ts +6 -5
- package/dist/local/store/key-value/adapter.d.ts.map +1 -1
- package/dist/local/store/key-value/adapter.js +21 -19
- package/dist/local/store/key-value/adapter.js.map +1 -1
- package/dist/local/store/key-value/receive-work.d.ts +0 -5
- package/dist/local/store/key-value/receive-work.d.ts.map +1 -1
- package/dist/local/store/key-value/receive-work.js +0 -16
- package/dist/local/store/key-value/receive-work.js.map +1 -1
- package/dist/local/store/node/adapter.js +2 -2
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/react-native/adapter.js +2 -2
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/receive-work.d.ts +32 -32
- package/dist/local/store/receive-work.d.ts.map +1 -1
- package/dist/local/store/receive-work.js +112 -65
- package/dist/local/store/receive-work.js.map +1 -1
- package/dist/local/store/received-content.d.ts +0 -5
- package/dist/local/store/received-content.d.ts.map +1 -1
- package/dist/local/store/received-content.js +0 -17
- package/dist/local/store/received-content.js.map +1 -1
- package/dist/local/store/reliability.d.ts +191 -53
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/reliability.js +517 -37
- package/dist/local/store/reliability.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.d.ts +1 -8
- package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.js +1 -18
- package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -1
- package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/local/store/sqlite/migrations.js +8 -0
- package/dist/local/store/sqlite/migrations.js.map +1 -1
- package/dist/local/store/sqlite/store.d.ts +5 -5
- package/dist/local/store/sqlite/store.d.ts.map +1 -1
- package/dist/local/store/sqlite/store.js +29 -9
- package/dist/local/store/sqlite/store.js.map +1 -1
- package/dist/local/store/web/adapter.d.ts +11 -10
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +69 -51
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/store/web-sqlite/adapter.js +2 -2
- package/dist/local/store/web-sqlite/adapter.js.map +1 -1
- package/dist/types/api.d.ts +50 -71
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/errors.d.ts +52 -18
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +58 -17
- package/dist/types/errors.js.map +1 -1
- package/docs/ASSURANCE.md +5 -5
- package/docs/DEVIATIONS.md +126 -9
- package/docs/ERROR_HANDLING.md +38 -23
- package/docs/GETTING_STARTED.md +17 -0
- package/local/store/README.md +32 -8
- package/package.json +1 -1
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { GroupFetchDenial } from '../internal/groups/receive-record.js';
|
|
2
2
|
import type { GroupContentContext, InspectedSignalProtocolContent } from './content-adapter.js';
|
|
3
|
+
/**
|
|
4
|
+
* True when a raw group ID names a managed group: its group identifier in
|
|
5
|
+
* lowercase hex. Any other ID names an ad hoc group.
|
|
6
|
+
*
|
|
7
|
+
* @param groupId - A raw group ID, with no `open-e2ee:group:` prefix
|
|
8
|
+
*/
|
|
9
|
+
export declare function isManagedGroupId(groupId: string): boolean;
|
|
3
10
|
/**
|
|
4
11
|
* Why the client delivers no group content and never will.
|
|
5
12
|
*
|
|
6
13
|
* `legacy-no-context`: the content of a managed group carries no group
|
|
7
|
-
* context
|
|
8
|
-
* put the group context in group content
|
|
9
|
-
*
|
|
10
|
-
* an SDK 11 sender is not delivered. Move every sender to SDK 12.0.0 or
|
|
11
|
-
* later before that version.
|
|
14
|
+
* context. The client denies all such content, also when it has state of
|
|
15
|
+
* the group. SDK 12.0.0 and later put the group context in group content,
|
|
16
|
+
* so content from an SDK 11 sender is not delivered.
|
|
12
17
|
*/
|
|
13
18
|
export type GroupReceiveDenial = 'malformed-context' | 'context-mismatch' | 'blocked' | 'sender-not-member' | 'recipient-not-member' | 'sender-lacks-permission' | GroupFetchDenial | 'legacy-no-context' | 'configuration' | 'unverified-cap' | 'sync-from-other-account';
|
|
14
19
|
/** Why the client cannot decide on group content yet. */
|
|
@@ -41,10 +46,10 @@ export declare class GroupReceiveRefusedError extends Error {
|
|
|
41
46
|
* The client cannot decide on group content yet, because its group state
|
|
42
47
|
* is not current. The content is committed in a receive record under
|
|
43
48
|
* `messageId`, and the receive queue decides it when the group state
|
|
44
|
-
* updates.
|
|
45
|
-
*
|
|
46
|
-
* ratchet step. `messageId` is absent only on an
|
|
47
|
-
* record backs.
|
|
49
|
+
* updates. No client method throws it: `processIncomingEnvelope` gives a
|
|
50
|
+
* `pending` outcome for it. A redelivery of the envelope finds the record
|
|
51
|
+
* and spends no second ratchet step. `messageId` is absent only on an
|
|
52
|
+
* error that no receive record backs.
|
|
48
53
|
*/
|
|
49
54
|
export declare class GroupReceiveUnavailableError extends Error {
|
|
50
55
|
readonly reason: GroupReceiveUnavailability;
|
|
@@ -58,6 +63,8 @@ export declare class GroupReceiveUnavailableError extends Error {
|
|
|
58
63
|
* content is content of the own account. A sent transcript names the
|
|
59
64
|
* conversation that its content is delivered under, so the refusal comes
|
|
60
65
|
* before any group decision on the content.
|
|
66
|
+
* A `GroupKeySync` carries a group master key, so the refusal also comes
|
|
67
|
+
* before its receive writes a group record or a master key.
|
|
61
68
|
*
|
|
62
69
|
* @param inspected - The inspection of the content
|
|
63
70
|
* @param senderId - The sender of the content
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-receive-authorization.d.ts","sourceRoot":"","sources":["../../client/group-receive-authorization.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAO1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"group-receive-authorization.d.ts","sourceRoot":"","sources":["../../client/group-receive-authorization.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAO1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAQ7F;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAC1B,mBAAmB,GACnB,kBAAkB,GAClB,SAAS,GACT,mBAAmB,GACnB,sBAAsB,GACtB,yBAAyB,GACzB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,yBAAyB,CAAC;AAE9B,yDAAyD;AACzD,MAAM,MAAM,0BAA0B,GAClC,gBAAgB,GAChB,eAAe,GACf,mBAAmB,GACnB,uBAAuB,CAAC;AAE5B,8CAA8C;AAC9C,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,0BAA0B,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAGrC,QAAQ,CAAC,MAAM,EAAE,kBAAkB;IAF/C,SAAkB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CAAwC;AACxC,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;AA+H/F,iFAAiF;AACjF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,CAAC,mBAAmB,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,EAC7D,SAAS,CAAC,EAAE,MAAM,GACjB,wBAAwB,GAAG,4BAA4B,CAIzD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,aAAa,CAAC;AAEpF,2DAA2D;AAC3D,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAEnG;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAGrC,QAAQ,CAAC,OAAO,EAAE,MAAM;IAFpC,SAAkB,IAAI,8BAA8B;IAEpD,YAAqB,OAAO,EAAE,MAAM,EAEnC;CACF"}
|
|
@@ -4,11 +4,19 @@ import { GroupAction, canPerformAction } from '../internal/groups/access-control
|
|
|
4
4
|
import { createGroupId, extractGroupId } from '../internal/groups/group-id.js';
|
|
5
5
|
import { GROUP_IDENTIFIER_LEN, deriveGroupSecretParams, } from '../internal/protocol/zk/groups/group-params.js';
|
|
6
6
|
import { SERVICE_ID_ACI, serviceIdBinary } from '../internal/protocol/zk/groups/uid-struct.js';
|
|
7
|
-
// A managed group's raw ID is its group identifier in lowercase hex.
|
|
8
7
|
const MANAGED_GROUP_ID = new RegExp(`^[0-9a-f]{${GROUP_IDENTIFIER_LEN * 2}}$`);
|
|
9
8
|
const MASTER_KEY_LEN = 32;
|
|
10
9
|
/** How long a receive waits before it tries an unresolved sender again. */
|
|
11
10
|
const SENDER_RESOLUTION_RETRY_MS = 30_000;
|
|
11
|
+
/**
|
|
12
|
+
* True when a raw group ID names a managed group: its group identifier in
|
|
13
|
+
* lowercase hex. Any other ID names an ad hoc group.
|
|
14
|
+
*
|
|
15
|
+
* @param groupId - A raw group ID, with no `open-e2ee:group:` prefix
|
|
16
|
+
*/
|
|
17
|
+
export function isManagedGroupId(groupId) {
|
|
18
|
+
return MANAGED_GROUP_ID.test(groupId);
|
|
19
|
+
}
|
|
12
20
|
/**
|
|
13
21
|
* The client delivers no group content: its context is malformed or names
|
|
14
22
|
* another group, the group is blocked, or the verified group state refuses
|
|
@@ -27,10 +35,10 @@ export class GroupReceiveRefusedError extends Error {
|
|
|
27
35
|
* The client cannot decide on group content yet, because its group state
|
|
28
36
|
* is not current. The content is committed in a receive record under
|
|
29
37
|
* `messageId`, and the receive queue decides it when the group state
|
|
30
|
-
* updates.
|
|
31
|
-
*
|
|
32
|
-
* ratchet step. `messageId` is absent only on an
|
|
33
|
-
* record backs.
|
|
38
|
+
* updates. No client method throws it: `processIncomingEnvelope` gives a
|
|
39
|
+
* `pending` outcome for it. A redelivery of the envelope finds the record
|
|
40
|
+
* and spends no second ratchet step. `messageId` is absent only on an
|
|
41
|
+
* error that no receive record backs.
|
|
34
42
|
*/
|
|
35
43
|
export class GroupReceiveUnavailableError extends Error {
|
|
36
44
|
reason;
|
|
@@ -49,6 +57,8 @@ export class GroupReceiveUnavailableError extends Error {
|
|
|
49
57
|
* content is content of the own account. A sent transcript names the
|
|
50
58
|
* conversation that its content is delivered under, so the refusal comes
|
|
51
59
|
* before any group decision on the content.
|
|
60
|
+
* A `GroupKeySync` carries a group master key, so the refusal also comes
|
|
61
|
+
* before its receive writes a group record or a master key.
|
|
52
62
|
*
|
|
53
63
|
* @param inspected - The inspection of the content
|
|
54
64
|
* @param senderId - The sender of the content
|
|
@@ -70,7 +80,7 @@ export function refuseSyncFromOtherAccount(inspected, senderId, ownUserId) {
|
|
|
70
80
|
*/
|
|
71
81
|
export function classifyGroupContent(transportGroupId, inspected) {
|
|
72
82
|
const context = inspected.groupContext;
|
|
73
|
-
const managedOrContext = (groupId) => context !== undefined || (groupId !== undefined &&
|
|
83
|
+
const managedOrContext = (groupId) => context !== undefined || (groupId !== undefined && isManagedGroupId(groupId));
|
|
74
84
|
// The transport binds content to a group before the content names one:
|
|
75
85
|
// content that a sender key decrypted, or that came beside a distribution,
|
|
76
86
|
// is content of that group whatever its shape, and never a transcript.
|
|
@@ -121,10 +131,11 @@ export function groupOfContext(claim) {
|
|
|
121
131
|
* cap of the sender device. The revision raises the group's required
|
|
122
132
|
* revision.
|
|
123
133
|
* 3. A blocked group drops the content with no report.
|
|
124
|
-
* 4.
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
134
|
+
* 4. Content with no context is denied as `legacy-no-context`, also when
|
|
135
|
+
* the client has state of the group.
|
|
136
|
+
* 5. When no state covers the claimed revision, the fetcher updates the
|
|
137
|
+
* group first.
|
|
138
|
+
* 6. The recipient and the sender must be members, and the sender must be
|
|
128
139
|
* allowed to send. A sent transcript checks only the recipient.
|
|
129
140
|
*
|
|
130
141
|
* An unavailable verdict keeps no state here. The receive queue owns the
|
|
@@ -149,12 +160,10 @@ export function createGroupReceiveEvaluator(options) {
|
|
|
149
160
|
if (await options.isGroupBlocked?.(createGroupId(groupId))) {
|
|
150
161
|
return { kind: 'denied', reason: 'blocked' };
|
|
151
162
|
}
|
|
163
|
+
if (!context)
|
|
164
|
+
return { kind: 'denied', reason: 'legacy-no-context' };
|
|
152
165
|
let state = await store.getGroupState(groupId);
|
|
153
|
-
if (!context) {
|
|
154
|
-
if (!state)
|
|
155
|
-
return { kind: 'denied', reason: 'legacy-no-context' };
|
|
156
|
-
}
|
|
157
|
-
else if (!state || state.revision < context.revision) {
|
|
166
|
+
if (!state || state.revision < context.revision) {
|
|
158
167
|
const freshness = await fetcher.ensureFresh(groupId, {
|
|
159
168
|
revision: context.revision,
|
|
160
169
|
...(context.groupChange && { change: context.groupChange }),
|
|
@@ -257,7 +266,7 @@ export class GroupResendDeferredError extends Error {
|
|
|
257
266
|
export function createGroupMembershipChecker(store, resolveAcis, isCurrentMember, fetcher) {
|
|
258
267
|
return async (groupId, userId) => {
|
|
259
268
|
const rawGroupId = extractGroupId(groupId);
|
|
260
|
-
if (!
|
|
269
|
+
if (!isManagedGroupId(rawGroupId)) {
|
|
261
270
|
if (!isCurrentMember)
|
|
262
271
|
return 'no-source';
|
|
263
272
|
return (await isCurrentMember(createGroupId(rawGroupId), userId)) ? 'member' : 'not-member';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-receive-authorization.js","sourceRoot":"","sources":["../../client/group-receive-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAgB,MAAM,6BAA6B,CAAC;AAI1F,OAAO,EACL,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAI5F,
|
|
1
|
+
{"version":3,"file":"group-receive-authorization.js","sourceRoot":"","sources":["../../client/group-receive-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAgB,MAAM,6BAA6B,CAAC;AAI1F,OAAO,EACL,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAI5F,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D,MAAM,GAAG,GAAG,CAAC,MAAM,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5F,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/client/hosted.d.ts
CHANGED
|
@@ -265,13 +265,13 @@ export declare function advanceHostedRelayIdentityMigration(options: HostedRelay
|
|
|
265
265
|
*
|
|
266
266
|
* The call copies the master key of each group that `activeGroupStore` lists
|
|
267
267
|
* into the linked device's group store: `groups.store`, or the SDK group store
|
|
268
|
-
* on the linked store. The copy runs in the calling process, so
|
|
269
|
-
*
|
|
270
|
-
* with `groups` fetches each copied group. A group record that an
|
|
271
|
-
* release wrote, and that the active device has not read since, is not
|
|
272
|
-
* and is not copied. Read each group once on the active device before
|
|
273
|
-
* link to copy it. A linked group store that lists a group that the link
|
|
274
|
-
* not write is refused with `HostedRelayDeviceLinkError` before any write.
|
|
268
|
+
* on the linked store. The copy runs in the calling process, so the link sends
|
|
269
|
+
* no master key through the Relay. It runs with no `groups` option too, and a
|
|
270
|
+
* later client with `groups` fetches each copied group. A group record that an
|
|
271
|
+
* earlier release wrote, and that the active device has not read since, is not
|
|
272
|
+
* listed and is not copied. Read each group once on the active device before
|
|
273
|
+
* the link to copy it. A linked group store that lists a group that the link
|
|
274
|
+
* did not write is refused with `HostedRelayDeviceLinkError` before any write.
|
|
275
275
|
* The copied keys live in the linked device's group store. The SDK does not
|
|
276
276
|
* move them again. A later move of that store is the application's store move.
|
|
277
277
|
*
|
package/dist/client/hosted.js
CHANGED
|
@@ -617,13 +617,13 @@ async function storeLinkedIdentityRegistration(storage, identity, marker) {
|
|
|
617
617
|
*
|
|
618
618
|
* The call copies the master key of each group that `activeGroupStore` lists
|
|
619
619
|
* into the linked device's group store: `groups.store`, or the SDK group store
|
|
620
|
-
* on the linked store. The copy runs in the calling process, so
|
|
621
|
-
*
|
|
622
|
-
* with `groups` fetches each copied group. A group record that an
|
|
623
|
-
* release wrote, and that the active device has not read since, is not
|
|
624
|
-
* and is not copied. Read each group once on the active device before
|
|
625
|
-
* link to copy it. A linked group store that lists a group that the link
|
|
626
|
-
* not write is refused with `HostedRelayDeviceLinkError` before any write.
|
|
620
|
+
* on the linked store. The copy runs in the calling process, so the link sends
|
|
621
|
+
* no master key through the Relay. It runs with no `groups` option too, and a
|
|
622
|
+
* later client with `groups` fetches each copied group. A group record that an
|
|
623
|
+
* earlier release wrote, and that the active device has not read since, is not
|
|
624
|
+
* listed and is not copied. Read each group once on the active device before
|
|
625
|
+
* the link to copy it. A linked group store that lists a group that the link
|
|
626
|
+
* did not write is refused with `HostedRelayDeviceLinkError` before any write.
|
|
627
627
|
* The copied keys live in the linked device's group store. The SDK does not
|
|
628
628
|
* move them again. A later move of that store is the application's store move.
|
|
629
629
|
*
|
package/dist/client/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type { AttachmentTransferOptions, SignalProtocolClientContext, DataMessag
|
|
|
28
28
|
export { isOutgoingMessageError } from "./types.js";
|
|
29
29
|
export { DeviceSetReconciliationError, RelayProtocolError, type DeviceSetDevice, type DeviceSetLastRefusal, type DeviceSetPhase, type DeviceSetRefusalAccount, type DeviceSetUnresolved, type DeviceSetUnresolvedReason, type RelayProtocolErrorCode, type RelayProtocolRoute, } from "./device-set-reconciliation.js";
|
|
30
30
|
export { GroupReceiveRefusedError, type GroupReceiveDenial, GroupReceiveUnavailableError, type GroupReceiveUnavailability, GroupResendDeferredError, } from "./group-receive-authorization.js";
|
|
31
|
-
export type { BlockedRecipientsSyncInput, GroupContentContext, InspectedSignalProtocolContent, MediaAttachmentDeleteSyncInput, ParsedReceiptContent, ParsedTypingContent, ParsedSyncContent, ConfigurationSyncInput, ReadSyncEntryInput, RecipientUsernameSyncInput, SentSyncTranscriptInput, TaskNotificationAckSyncInput, UsernameStateSyncInput, VerificationStateSyncInput, ViewOnceOpenSyncInput, SignalProtocolContentAdapter, } from "./content-adapter.js";
|
|
31
|
+
export type { BlockedRecipientsSyncInput, GroupContentContext, GroupKeySyncInput, InspectedSignalProtocolContent, MediaAttachmentDeleteSyncInput, ParsedReceiptContent, ParsedTypingContent, ParsedSyncContent, ConfigurationSyncInput, ReadSyncEntryInput, RecipientUsernameSyncInput, SentSyncTranscriptInput, TaskNotificationAckSyncInput, UsernameStateSyncInput, VerificationStateSyncInput, ViewOnceOpenSyncInput, SignalProtocolContentAdapter, } from "./content-adapter.js";
|
|
32
32
|
export { createDefaultSignalProtocolContentAdapter } from "./content-adapter.js";
|
|
33
33
|
export type { DecryptedEnvelope, DeliveredEvent, DeliveryErrorCause, DeliveryErrorEvent, DeliveryRecoveredEvent, DeliverySource, ReceiveExpiredEvent, RetryTerminalClass, RetryTerminalEvent, RetryTerminalRecoveryEvent, SendOutcomeEvent, SignalProtocolClientHooks, } from "./event-hooks.js";
|
|
34
34
|
export type { GroupInitStatus } from "./group-init-status.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,CAAC;AACV,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,KAAK,iCAAiC,EACtC,KAAK,sCAAsC,EAC3C,KAAK,kCAAkC,GACxC,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,oBAAoB,EACpB,wBAAwB,EACxB,+BAA+B,EAC/B,mCAAmC,EACn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C3B,OAAO,EAAE,yCAAyC,EAAE,MAAM,mBAAmB,CAAC;AAC9E,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EACV,8CAA8C,EAC9C,yCAAyC,EACzC,4CAA4C,EAC5C,yBAAyB,EACzB,0CAA0C,EAC1C,wCAAwC,EACxC,qCAAqC,EACrC,sCAAsC,EACtC,+BAA+B,EAC/B,gDAAgD,EAChD,sCAAsC,EACtC,gDAAgD,EAChD,uCAAuC,EACvC,qCAAqC,EACrC,yCAAyC,EACzC,wCAAwC,EACxC,sCAAsC,EACtC,sCAAsC,EACtC,sCAAsC,EACtC,8CAA8C,EAC9C,oCAAoC,EACpC,qCAAqC,EACrC,8CAA8C,EAC9C,iDAAiD,EACjD,+CAA+C,EAC/C,mCAAmC,GACpC,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,YAAY,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,gCAAgC,EAAE,KAAK,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,EAAE,sBAAsB,EAAE,KAAK,0BAA0B,EAAE,KAAK,sBAAsB,EAC3F,KAAK,yBAAyB,EAAE,KAAK,iCAAiC,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAoBA,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AAE,MAAM,UAAU,CAAC;AA2B1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,GASnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,wBAAwB,EAExB,4BAA4B,EAE5B,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AAoBvC,OAAO,EAAE,yCAAyC,EAAE,MAAM,mBAAmB,CAAC;AA6C9E,oDAAoD;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMnD,OAAO,EAAE,gCAAgC,EAA0C,MAAM,iBAAiB,CAAC;AAC3G,OAAO,EAAE,sBAAsB,EAC2C,MAAM,uBAAuB,CAAC"}
|
|
@@ -222,9 +222,6 @@
|
|
|
222
222
|
* starts. Tests: both V9 tests, "the retry deadline never deletes a
|
|
223
223
|
* committed receive record".
|
|
224
224
|
* - The separate sender key install and its replay: see `restoreCommitted`.
|
|
225
|
-
* - Converted SDK 11 rows have no Signal form. The data-preserving migration
|
|
226
|
-
* rule keeps them, and the redelivered envelope fills them. Tests: the
|
|
227
|
-
* legacy conversion suite and the converted row tests.
|
|
228
225
|
*/
|
|
229
226
|
import type { ReceiveWorkRecord } from '../types/api.js';
|
|
230
227
|
import { type ProcessedEnvelopeOutcome, type ReceivedMessageKey } from '../local/store/reliability.js';
|
|
@@ -271,7 +268,9 @@ export interface ReceiveQueuePassResult {
|
|
|
271
268
|
*
|
|
272
269
|
* @param received - The key of the content that the application got. The
|
|
273
270
|
* step records it, so a later copy with the same key is dropped. A
|
|
274
|
-
* receipt record carries its key, and the step records that key again.
|
|
271
|
+
* receipt record carries its key, and the step records that key again. A
|
|
272
|
+
* receipt record that SDK 13.x wrote carries a key with four fields, and
|
|
273
|
+
* the step records it under its sender user and timestamp only.
|
|
275
274
|
* @returns False, with nothing written, when the stored revision changed.
|
|
276
275
|
*/
|
|
277
276
|
export declare function completeReceiveWork(ctx: Pick<SignalProtocolClientContext, 'storage' | 'hooks' | 'logger'>, record: ReceiveWorkRecord, outcome?: ProcessedEnvelopeOutcome, received?: ReceivedMessageKey): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receive-queue.d.ts","sourceRoot":"","sources":["../../client/receive-queue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"receive-queue.d.ts","sourceRoot":"","sources":["../../client/receive-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgOG;AAIH,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAQL,KAAK,wBAAwB,EAE7B,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAcpC,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAO9B,OAAO,KAAK,EAEV,eAAe,EACf,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAsB,CAAC;AAKvD,mFAAmF;AACnF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,wBAAwB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,sBAA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IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,EACjD,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAWnC"}
|
|
@@ -222,11 +222,7 @@
|
|
|
222
222
|
* starts. Tests: both V9 tests, "the retry deadline never deletes a
|
|
223
223
|
* committed receive record".
|
|
224
224
|
* - The separate sender key install and its replay: see `restoreCommitted`.
|
|
225
|
-
* - Converted SDK 11 rows have no Signal form. The data-preserving migration
|
|
226
|
-
* rule keeps them, and the redelivered envelope fills them. Tests: the
|
|
227
|
-
* legacy conversion suite and the converted row tests.
|
|
228
225
|
*/
|
|
229
|
-
import { bytesToBase64, sha256 } from '../internal/crypto/index.js';
|
|
230
226
|
import { extractGroupId } from '../internal/groups/index.js';
|
|
231
227
|
import { completeReceiveRecord, getProcessedEnvelope, hasReceivedTimestamp, recordReceivedTimestamp, storeProcessedEnvelope, withProcessedEnvelopeLock, writeProcessedEnvelopes, } from '../local/store/reliability.js';
|
|
232
228
|
import { RECEIVE_WORK_DEFAULT_LIMIT, sizedReceiveWork } from '../local/store/receive-work.js';
|
|
@@ -277,16 +273,13 @@ class ReceiveHookMissing extends Error {
|
|
|
277
273
|
const groupConversation = (groupId) => `group:${extractGroupId(groupId)}`;
|
|
278
274
|
/**
|
|
279
275
|
* The conversation key of a record before the pass restores its content:
|
|
280
|
-
* the group that the record stores, otherwise the sender account.
|
|
281
|
-
*
|
|
282
|
-
* key" in the module comment.
|
|
276
|
+
* the group that the record stores, otherwise the sender account. See
|
|
277
|
+
* "Order key" in the module comment.
|
|
283
278
|
*/
|
|
284
279
|
function storedConversationOf(record) {
|
|
285
280
|
if (record.groupId !== undefined)
|
|
286
281
|
return groupConversation(record.groupId);
|
|
287
|
-
return record.senderUserId
|
|
288
|
-
? `work:${record.workId}`
|
|
289
|
-
: `account:${record.senderUserId}`;
|
|
282
|
+
return `account:${record.senderUserId}`;
|
|
290
283
|
}
|
|
291
284
|
/**
|
|
292
285
|
* The raw managed group of restored content before its group decision:
|
|
@@ -400,7 +393,9 @@ function withoutContent(record) {
|
|
|
400
393
|
*
|
|
401
394
|
* @param received - The key of the content that the application got. The
|
|
402
395
|
* step records it, so a later copy with the same key is dropped. A
|
|
403
|
-
* receipt record carries its key, and the step records that key again.
|
|
396
|
+
* receipt record carries its key, and the step records that key again. A
|
|
397
|
+
* receipt record that SDK 13.x wrote carries a key with four fields, and
|
|
398
|
+
* the step records it under its sender user and timestamp only.
|
|
404
399
|
* @returns False, with nothing written, when the stored revision changed.
|
|
405
400
|
*/
|
|
406
401
|
export async function completeReceiveWork(ctx, record, outcome, received) {
|
|
@@ -555,9 +550,9 @@ async function expireReceiveWork(ctx, record) {
|
|
|
555
550
|
receivedAt: record.receivedAt,
|
|
556
551
|
stage: record.stage === 'awaiting-completion' ? 'awaiting-completion' : 'decrypted',
|
|
557
552
|
origin: record.origin,
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
553
|
+
messageId: record.messageId,
|
|
554
|
+
senderId: record.senderUserId,
|
|
555
|
+
senderDeviceId: record.senderDeviceId,
|
|
561
556
|
...(record.groupId !== undefined && { groupId: record.groupId }),
|
|
562
557
|
...(record.failedEnvelopeId !== undefined && { failedEnvelopeId: record.failedEnvelopeId }),
|
|
563
558
|
};
|
|
@@ -1080,9 +1075,6 @@ export class ReceiveQueue {
|
|
|
1080
1075
|
return WAIT(expiresAt);
|
|
1081
1076
|
if (record.stage === 'receipt-due')
|
|
1082
1077
|
return this.receiptStep(pass, record, now);
|
|
1083
|
-
// A converted legacy record waits for its redelivery.
|
|
1084
|
-
if (record.awaitingEnvelope)
|
|
1085
|
-
return WAIT(expiresAt);
|
|
1086
1078
|
// An earlier record of the conversation holds back this record. See
|
|
1087
1079
|
// "Order key" in the module comment.
|
|
1088
1080
|
if (isBlocked(blocked, record, conversation)) {
|
|
@@ -1130,6 +1122,13 @@ export class ReceiveQueue {
|
|
|
1130
1122
|
this.forget(record.workId);
|
|
1131
1123
|
return DONE;
|
|
1132
1124
|
}
|
|
1125
|
+
// A GroupKeySync from an own device is SDK content. Its receive applies
|
|
1126
|
+
// the group master key, and the application never gets it.
|
|
1127
|
+
if (await ctx.cipher.consumeGroupKeySync(content)) {
|
|
1128
|
+
await completeReceiveWork(ctx, record);
|
|
1129
|
+
this.forget(record.workId);
|
|
1130
|
+
return DONE;
|
|
1131
|
+
}
|
|
1133
1132
|
// The pass knows the conversation of the content only now. An earlier
|
|
1134
1133
|
// record of that conversation holds back this record before its group
|
|
1135
1134
|
// decision, so a later record never applies a group change first. See
|
|
@@ -1309,22 +1308,15 @@ export class ReceiveQueue {
|
|
|
1309
1308
|
return NOT_DELIVERED;
|
|
1310
1309
|
}
|
|
1311
1310
|
// A manual resend posts under a new message ID, so the envelope ID
|
|
1312
|
-
// check misses it. The device drops
|
|
1313
|
-
//
|
|
1314
|
-
//
|
|
1315
|
-
// so a stop after the hook and before the completion runs
|
|
1316
|
-
// When a receipt is owed, the key is recorded right after
|
|
1317
|
-
// receipt-due write, and again with the completion of the receipt.
|
|
1311
|
+
// check misses it. The device drops content whose sender user and
|
|
1312
|
+
// content timestamp match content that the application already has,
|
|
1313
|
+
// from any device of the sender. The key is recorded with the completion
|
|
1314
|
+
// of the receive, so a stop after the hook and before the completion runs
|
|
1315
|
+
// the hook again. When a receipt is owed, the key is recorded right after
|
|
1316
|
+
// the receipt-due write, and again with the completion of the receipt.
|
|
1318
1317
|
const timestamp = inspected.timestamp;
|
|
1319
1318
|
const delivered = ctx.contentAdapter.withoutGroupContext(decrypted.content);
|
|
1320
|
-
const received = typeof timestamp === 'number'
|
|
1321
|
-
? {
|
|
1322
|
-
senderUserId: content.senderUserId,
|
|
1323
|
-
senderDeviceId: content.senderDeviceId,
|
|
1324
|
-
timestamp,
|
|
1325
|
-
contentDigest: bytesToBase64(await sha256(new TextEncoder().encode(delivered))),
|
|
1326
|
-
}
|
|
1327
|
-
: undefined;
|
|
1319
|
+
const received = typeof timestamp === 'number' ? { senderUserId: content.senderUserId, timestamp } : undefined;
|
|
1328
1320
|
if (received !== undefined && (await hasReceivedTimestamp(ctx.storage, received))) {
|
|
1329
1321
|
return NOT_DELIVERED;
|
|
1330
1322
|
}
|
|
@@ -1356,7 +1348,7 @@ export class ReceiveQueue {
|
|
|
1356
1348
|
}
|
|
1357
1349
|
const { workId, senderUserId } = record;
|
|
1358
1350
|
const receipts = ctx.config.deliveryReceipts ?? 'auto';
|
|
1359
|
-
const batchReceipt = ctx.relay !== undefined && receipts !== 'off'
|
|
1351
|
+
const batchReceipt = ctx.relay !== undefined && receipts !== 'off'
|
|
1360
1352
|
? () => {
|
|
1361
1353
|
accumulateDeliveryReceipt(state.receiptAccumulator, senderUserId, record.senderTimestamp ?? record.receivedAt, callbacks.sendDeliveryReceipt, ctx.logger).then(() => this.receiptSettled(workId, undefined), (error) => this.receiptSettled(workId, error ?? new Error('Receipt send failed')));
|
|
1362
1354
|
}
|