@open-e2ee/signal-protocol-sdk 3.0.0 → 4.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/ADAPTERS.md +4 -4
- package/CHANGELOG.md +16 -0
- package/README.md +2 -2
- package/SECURITY.md +2 -2
- package/TROUBLESHOOTING.md +4 -4
- package/client/README.md +2 -2
- package/dist/blocking/manager.d.ts +2 -2
- package/dist/blocking/manager.d.ts.map +1 -1
- package/dist/blocking/manager.js.map +1 -1
- package/dist/client/client.d.ts +32 -32
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +42 -42
- package/dist/client/client.js.map +1 -1
- package/dist/client/compose.d.ts +7 -7
- package/dist/client/compose.d.ts.map +1 -1
- package/dist/client/compose.js +2 -2
- package/dist/client/compose.js.map +1 -1
- package/dist/client/config.d.ts +10 -10
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/dual-store.d.ts +5 -5
- package/dist/client/dual-store.d.ts.map +1 -1
- package/dist/client/dual-store.js.map +1 -1
- package/dist/client/endorsement-manager.d.ts +2 -2
- package/dist/client/endorsement-manager.d.ts.map +1 -1
- package/dist/client/endorsement-manager.js.map +1 -1
- package/dist/client/files.d.ts +1 -1
- package/dist/client/files.js +1 -1
- package/dist/client/group-outbox.d.ts +4 -4
- package/dist/client/group-outbox.d.ts.map +1 -1
- package/dist/client/group-sealed-sender.d.ts +2 -2
- package/dist/client/group-sealed-sender.d.ts.map +1 -1
- package/dist/client/groups.d.ts +1 -1
- package/dist/client/groups.js +1 -1
- package/dist/client/headless.d.ts +10 -10
- package/dist/client/headless.d.ts.map +1 -1
- package/dist/client/headless.js +3 -3
- package/dist/client/headless.js.map +1 -1
- package/dist/client/hosted-groups.d.ts +2 -2
- package/dist/client/hosted-groups.d.ts.map +1 -1
- package/dist/client/hosted-push.d.ts +2 -2
- package/dist/client/hosted-push.d.ts.map +1 -1
- package/dist/client/hosted-transport.d.ts +8 -8
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/hosted.d.ts +8 -8
- package/dist/client/hosted.d.ts.map +1 -1
- package/dist/client/hosted.js +2 -2
- package/dist/client/hosted.js.map +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/key-rotation-core.d.ts +9 -9
- package/dist/client/key-rotation-core.d.ts.map +1 -1
- package/dist/client/key-rotation-core.js +2 -2
- package/dist/client/key-rotation-core.js.map +1 -1
- package/dist/client/key-rotation.d.ts +1 -1
- package/dist/client/key-rotation.js +1 -1
- package/dist/client/media-queue-persistence.d.ts +2 -2
- package/dist/client/media-queue-persistence.d.ts.map +1 -1
- package/dist/client/media-queue-persistence.js.map +1 -1
- package/dist/client/media.js.map +1 -1
- package/dist/client/messages.d.ts +1 -1
- package/dist/client/messages.js +1 -1
- package/dist/client/multi-device.d.ts +1 -1
- package/dist/client/multi-device.js +1 -1
- package/dist/client/prekeys.d.ts +1 -1
- package/dist/client/prekeys.js +1 -1
- package/dist/client/relay-subscription.d.ts +1 -1
- package/dist/client/relay-subscription.js +1 -1
- package/dist/client/retry.d.ts +3 -3
- package/dist/client/retry.d.ts.map +1 -1
- package/dist/client/retry.js +1 -1
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sealed-sender.d.ts +5 -5
- package/dist/client/sealed-sender.d.ts.map +1 -1
- package/dist/client/sealed-sender.js.map +1 -1
- package/dist/client/sessions.d.ts +3 -3
- package/dist/client/sessions.d.ts.map +1 -1
- package/dist/client/sessions.js +1 -1
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +5 -5
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/state.d.ts +1 -1
- package/dist/client/state.js +1 -1
- package/dist/client/types.d.ts +10 -10
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js +1 -1
- package/dist/device/connection.d.ts.map +1 -1
- package/dist/device/connection.js.map +1 -1
- package/dist/device/device-id.d.ts +2 -2
- package/dist/device/device-id.d.ts.map +1 -1
- package/dist/device/device-id.js.map +1 -1
- package/dist/device/index.d.ts +1 -1
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/lifecycle/index.d.ts +1 -1
- package/dist/device/lifecycle/index.d.ts.map +1 -1
- package/dist/device/lifecycle/types.d.ts +8 -8
- package/dist/device/lifecycle/types.d.ts.map +1 -1
- package/dist/device/provisioning.d.ts +12 -12
- package/dist/device/provisioning.d.ts.map +1 -1
- package/dist/device/provisioning.js.map +1 -1
- package/dist/device/transfer.d.ts +13 -13
- package/dist/device/transfer.d.ts.map +1 -1
- package/dist/device/transfer.js.map +1 -1
- package/dist/device/types.d.ts +2 -2
- package/dist/device/types.d.ts.map +1 -1
- package/dist/groups/index.d.ts +1 -1
- package/dist/groups/index.d.ts.map +1 -1
- package/dist/groups/server.d.ts +1 -1
- package/dist/groups/server.d.ts.map +1 -1
- package/dist/hooks/use-connection-presence.d.ts +5 -5
- package/dist/hooks/use-connection-presence.d.ts.map +1 -1
- package/dist/hooks/use-connection-presence.js +1 -1
- package/dist/hooks/use-connection-presence.js.map +1 -1
- package/dist/hooks/use-group-membership.d.ts +2 -2
- package/dist/hooks/use-group-membership.d.ts.map +1 -1
- package/dist/hooks/use-group-membership.js.map +1 -1
- package/dist/hooks/use-key-rotation.d.ts +2 -2
- package/dist/hooks/use-key-rotation.d.ts.map +1 -1
- package/dist/hooks/use-session-health.d.ts +2 -2
- package/dist/hooks/use-session-health.d.ts.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts +4 -4
- package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
- package/dist/internal/groups/index.d.ts +1 -1
- package/dist/internal/groups/index.d.ts.map +1 -1
- package/dist/internal/groups/manager.d.ts +4 -4
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/groups/sdk-store.d.ts +4 -4
- package/dist/internal/groups/sdk-store.d.ts.map +1 -1
- package/dist/internal/groups/sdk-store.js.map +1 -1
- package/dist/internal/groups/server-engine.d.ts +2 -2
- package/dist/internal/groups/server-engine.d.ts.map +1 -1
- package/dist/internal/manager/index.d.ts +2 -2
- package/dist/internal/manager/index.d.ts.map +1 -1
- package/dist/internal/manager/index.js +1 -1
- package/dist/internal/manager/index.js.map +1 -1
- package/dist/internal/manager/manager.d.ts +22 -22
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +18 -18
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.d.ts +9 -9
- package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +2 -2
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts +3 -3
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts +3 -3
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/authenticator.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts +2 -2
- package/dist/internal/protocol/spqr/ml-kem-braid/index.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/index.js +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/index.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +2 -2
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +3 -3
- package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts +5 -5
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.js.map +1 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +4 -4
- package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/x3dh/x3dh.d.ts +3 -3
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
- package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
- package/dist/internal/sesame/device-registry.d.ts +16 -16
- package/dist/internal/sesame/device-registry.d.ts.map +1 -1
- package/dist/internal/sesame/device-registry.js +6 -6
- package/dist/internal/sesame/device-registry.js.map +1 -1
- package/dist/internal/sesame/index.d.ts +4 -4
- package/dist/internal/sesame/index.d.ts.map +1 -1
- package/dist/internal/sesame/index.js +2 -2
- package/dist/internal/sesame/index.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +8 -8
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +7 -7
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/sesame/types.d.ts +4 -4
- package/dist/internal/sesame/types.d.ts.map +1 -1
- package/dist/internal/session/cipher.d.ts +3 -3
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/internal/session/decryption.js.map +1 -1
- package/dist/internal/session/factory.d.ts +3 -3
- package/dist/internal/session/factory.d.ts.map +1 -1
- package/dist/internal/session/factory.js.map +1 -1
- package/dist/internal/session/handshake.d.ts +2 -2
- package/dist/internal/session/handshake.d.ts.map +1 -1
- package/dist/internal/session/handshake.js.map +1 -1
- package/dist/internal/session/ratchet.d.ts +4 -4
- package/dist/internal/session/ratchet.d.ts.map +1 -1
- package/dist/internal/session/ratchet.js.map +1 -1
- package/dist/internal/session/types.d.ts +5 -5
- package/dist/internal/session/types.d.ts.map +1 -1
- package/dist/internal/session/validation.d.ts +3 -3
- package/dist/internal/session/validation.d.ts.map +1 -1
- package/dist/internal/session/validation.js.map +1 -1
- package/dist/layers.d.ts +3 -3
- package/dist/layers.d.ts.map +1 -1
- package/dist/layers.js +11 -11
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts +8 -8
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +1 -1
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/database-key.d.ts +5 -5
- package/dist/local/store/expo/database-key.d.ts.map +1 -1
- package/dist/local/store/expo/database-key.js.map +1 -1
- package/dist/local/store/expo/index.d.ts +3 -3
- package/dist/local/store/expo/index.d.ts.map +1 -1
- package/dist/local/store/expo/key-storage.d.ts +4 -4
- package/dist/local/store/expo/key-storage.d.ts.map +1 -1
- package/dist/local/store/expo/key-storage.js.map +1 -1
- package/dist/local/store/index.d.ts +3 -3
- package/dist/local/store/index.d.ts.map +1 -1
- package/dist/local/store/index.js +1 -1
- package/dist/local/store/memory/adapter.d.ts +3 -3
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +1 -1
- package/dist/local/store/node/adapter.d.ts +2 -2
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/database.d.ts +2 -2
- package/dist/local/store/node/database.d.ts.map +1 -1
- package/dist/local/store/node/database.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts +2 -2
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/received-content.d.ts +2 -2
- package/dist/local/store/received-content.d.ts.map +1 -1
- package/dist/local/store/received-content.js.map +1 -1
- package/dist/local/store/reliability.d.ts +2 -2
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/web/adapter.d.ts +3 -3
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +1 -1
- package/dist/local/vault/expo-secure-store.d.ts +2 -2
- package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
- package/dist/local/vault/index.d.ts +1 -1
- package/dist/local/vault/index.d.ts.map +1 -1
- package/dist/logger.d.ts +4 -4
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/profile/contact-state.d.ts +2 -2
- package/dist/profile/contact-state.d.ts.map +1 -1
- package/dist/profile/contact-state.js.map +1 -1
- package/dist/profile/profile-key.d.ts +2 -2
- package/dist/profile/profile-key.d.ts.map +1 -1
- package/dist/profile/profile-key.js.map +1 -1
- package/dist/profile/update-service.d.ts +2 -2
- package/dist/profile/update-service.d.ts.map +1 -1
- package/dist/profile/update-service.js.map +1 -1
- package/dist/remote/relay/index.d.ts +4 -4
- package/dist/remote/relay/index.d.ts.map +1 -1
- package/dist/remote/relay/index.js +3 -3
- package/dist/remote/relay/memory/adapter.d.ts +4 -4
- package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
- package/dist/remote/relay/memory/adapter.js +4 -4
- package/dist/remote/relay/memory/adapter.js.map +1 -1
- package/dist/remote/relay/types.d.ts +9 -9
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/remote/relay/types.js +1 -1
- package/dist/types/api.d.ts +23 -23
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/docs/ASSURANCE.md +4 -4
- package/docs/CLIENT_COMPOSITION.md +4 -4
- package/docs/ERROR_HANDLING.md +2 -2
- package/docs/INTERFACES.md +15 -15
- package/docs/PACKAGE_SURFACE.md +4 -4
- package/examples/browser/index.html +1 -1
- package/groups/README.md +4 -4
- package/local/store/README.md +6 -6
- package/local/store/expo/README.md +1 -1
- package/local/store/memory/README.md +1 -1
- package/local/store/node/README.md +2 -2
- package/local/store/react-native/README.md +1 -1
- package/local/store/web/README.md +1 -1
- package/local/vault/README.md +1 -1
- package/package.json +1 -1
- package/remote/README.md +8 -8
- package/remote/relay/README.md +2 -2
- package/remote/relay/memory/README.md +1 -1
- package/types/README.md +2 -2
|
@@ -95,14 +95,14 @@ app code does not have to compose queue callbacks for ordinary sends. See
|
|
|
95
95
|
|
|
96
96
|
## Direct Client Creation
|
|
97
97
|
|
|
98
|
-
`
|
|
98
|
+
`DefaultSignalProtocolClient.create()` remains the low-level primitive. It uses the same
|
|
99
99
|
developer-facing protocol config:
|
|
100
100
|
|
|
101
101
|
<!-- doc-snippet:skip requires-external-context -->
|
|
102
102
|
```ts
|
|
103
|
-
import {
|
|
103
|
+
import { DefaultSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
104
104
|
|
|
105
|
-
const signal = await
|
|
105
|
+
const signal = await DefaultSignalProtocolClient.create(userId, {
|
|
106
106
|
// Low-level creation uses the same storage/relay/protocol concepts.
|
|
107
107
|
storage,
|
|
108
108
|
relay,
|
|
@@ -116,7 +116,7 @@ const signal = await SignalProtocolClient.create(userId, {
|
|
|
116
116
|
- Keep account/device identity in `identity`.
|
|
117
117
|
- Keep product security policy in `protocol`.
|
|
118
118
|
- Keep app logging, hooks, sealed sender, groups, and sender-key options at the
|
|
119
|
-
top level so they match `
|
|
119
|
+
top level so they match `DefaultSignalProtocolClient.create()`.
|
|
120
120
|
- Use `protocol.postQuantum: 'compatible'` only when the product explicitly
|
|
121
121
|
supports peers with no post-quantum material.
|
|
122
122
|
- Use `protocol.braid: 'disabled'` only when a product-reviewed constraint
|
package/docs/ERROR_HANDLING.md
CHANGED
|
@@ -281,9 +281,9 @@ The library includes structured logging for errors:
|
|
|
281
281
|
|
|
282
282
|
<!-- doc-snippet:skip requires-platform-adapters -->
|
|
283
283
|
```typescript
|
|
284
|
-
import {
|
|
284
|
+
import { DefaultSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
|
|
285
285
|
|
|
286
|
-
const signal = await
|
|
286
|
+
const signal = await DefaultSignalProtocolClient.create(userId, {
|
|
287
287
|
storage,
|
|
288
288
|
relay,
|
|
289
289
|
logger: {
|
package/docs/INTERFACES.md
CHANGED
|
@@ -12,31 +12,31 @@ policy.
|
|
|
12
12
|
|
|
13
13
|
```text
|
|
14
14
|
SignalProtocolClient
|
|
15
|
-
├──
|
|
16
|
-
├──
|
|
15
|
+
├── SignalProtocolLocalStore device-local protocol state
|
|
16
|
+
├── SignalProtocolRelayServer authenticated device, prekey, and envelope service
|
|
17
17
|
├── SignalProtocolRemoteObjectStore brokered encrypted-object operations (optional)
|
|
18
18
|
├── media callbacks application-owned attachment bytes and caches
|
|
19
19
|
└── lifecycle hooks application reactions and observability
|
|
20
20
|
|
|
21
21
|
Local-store bootstrap
|
|
22
|
-
└──
|
|
22
|
+
└── SignalProtocolLocalSecretVault small platform-managed bootstrap secrets
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
The interfaces are public contracts, but they do not make an implementation
|
|
26
26
|
secure by themselves. Each adapter must preserve the ownership and atomicity
|
|
27
27
|
requirements described below.
|
|
28
28
|
|
|
29
|
-
## `
|
|
29
|
+
## `SignalProtocolLocalStore`
|
|
30
30
|
|
|
31
|
-
`
|
|
31
|
+
`SignalProtocolLocalStore` persists the current device's identities, prekeys, sessions,
|
|
32
32
|
sender keys, contact trust, retry records, and operational metadata.
|
|
33
33
|
|
|
34
34
|
<!-- doc-snippet:skip requires-external-context -->
|
|
35
35
|
```ts
|
|
36
|
-
import type {
|
|
36
|
+
import type { SignalProtocolLocalStore } from "@open-e2ee/signal-protocol-sdk/local/store";
|
|
37
37
|
import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
38
38
|
|
|
39
|
-
const storage:
|
|
39
|
+
const storage: SignalProtocolLocalStore = appProtocolStore;
|
|
40
40
|
|
|
41
41
|
const client = await createSignalProtocolClient({
|
|
42
42
|
identity: { userId },
|
|
@@ -57,17 +57,17 @@ A production implementation must:
|
|
|
57
57
|
The [local-store guide](../local/store/README.md) lists the available adapters
|
|
58
58
|
and their status.
|
|
59
59
|
|
|
60
|
-
## `
|
|
60
|
+
## `SignalProtocolLocalSecretVault`
|
|
61
61
|
|
|
62
|
-
`
|
|
62
|
+
`SignalProtocolLocalSecretVault` is a deliberately small interface for bootstrap
|
|
63
63
|
secrets that must live outside the main local store, such as a database
|
|
64
64
|
encryption key.
|
|
65
65
|
|
|
66
66
|
<!-- doc-snippet:skip requires-external-context -->
|
|
67
67
|
```ts
|
|
68
|
-
import type {
|
|
68
|
+
import type { SignalProtocolLocalSecretVault } from "@open-e2ee/signal-protocol-sdk";
|
|
69
69
|
|
|
70
|
-
const vault:
|
|
70
|
+
const vault: SignalProtocolLocalSecretVault = {
|
|
71
71
|
getSecret: (name) => platformSecrets.getBytes(name),
|
|
72
72
|
setSecret: (name, value) => platformSecrets.setBytes(name, value),
|
|
73
73
|
deleteSecret: (name) => platformSecrets.delete(name),
|
|
@@ -79,21 +79,21 @@ device migration, uninstall persistence, and deletion behavior depend on the
|
|
|
79
79
|
selected platform service and host configuration. See the
|
|
80
80
|
[secret-vault guide](../local/vault/README.md).
|
|
81
81
|
|
|
82
|
-
## `
|
|
82
|
+
## `SignalProtocolRelayServer`
|
|
83
83
|
|
|
84
|
-
`
|
|
84
|
+
`SignalProtocolRelayServer` represents the authenticated application backend used for
|
|
85
85
|
device registration, account identity state, public prekeys, encrypted-envelope
|
|
86
86
|
delivery, provisioning, key rotation, and encrypted group coordination.
|
|
87
87
|
|
|
88
88
|
<!-- doc-snippet:skip requires-external-context -->
|
|
89
89
|
```ts
|
|
90
|
-
import type {
|
|
90
|
+
import type { SignalProtocolRelayServer } from "@open-e2ee/signal-protocol-sdk/remote/relay";
|
|
91
91
|
import { inMemoryRelay } from "@open-e2ee/signal-protocol-sdk/remote/relay/memory";
|
|
92
92
|
|
|
93
93
|
// Development uses the in-memory relay. Production connects to the OpenE2EE
|
|
94
94
|
// Signal Protocol Relay through `createHostedSignalProtocolClient()`, or to an
|
|
95
95
|
// application backend that implements this interface.
|
|
96
|
-
const relay:
|
|
96
|
+
const relay: SignalProtocolRelayServer = inMemoryRelay();
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
The application backend must:
|
package/docs/PACKAGE_SURFACE.md
CHANGED
|
@@ -147,7 +147,7 @@ Expo storage or the Convex R2 object store.
|
|
|
147
147
|
- `createHostedSignalProtocolClient()` from the package root for the OpenE2EE
|
|
148
148
|
Signal Protocol Relay
|
|
149
149
|
- `InMemorySignalProtocolRelayServer` / `inMemoryRelay()` for local development
|
|
150
|
-
- custom implementations via `
|
|
150
|
+
- custom implementations via `SignalProtocolRelayServer`
|
|
151
151
|
|
|
152
152
|
### Storage implementations
|
|
153
153
|
|
|
@@ -162,7 +162,7 @@ Expo storage or the Convex R2 object store.
|
|
|
162
162
|
backend-conformance kit)
|
|
163
163
|
- `NodeSignalProtocolStore` / `nodeStore()` for Node environments
|
|
164
164
|
- `InMemorySignalProtocolStore` / `inMemoryStore()` for local development
|
|
165
|
-
- custom implementations via `
|
|
165
|
+
- custom implementations via `SignalProtocolLocalStore`
|
|
166
166
|
|
|
167
167
|
### Remote object store
|
|
168
168
|
|
|
@@ -203,12 +203,12 @@ implement the same `MediaAttachmentTransfer` seam.
|
|
|
203
203
|
|
|
204
204
|
## Design notes
|
|
205
205
|
|
|
206
|
-
- `
|
|
206
|
+
- `DefaultSignalProtocolClient.create()` requires `storage`. There are no hidden
|
|
207
207
|
default adapters.
|
|
208
208
|
- `createSignalProtocolClient()` is the preferred composition helper when app
|
|
209
209
|
code owns multiple adapters.
|
|
210
210
|
- Linked devices must already contain provisioned identity material before
|
|
211
|
-
`
|
|
211
|
+
`DefaultSignalProtocolClient.create(..., { deviceId: 2 })`.
|
|
212
212
|
- Username-only apps typically run ACI-only. Phone-capable apps can enable both
|
|
213
213
|
ACI and PNI with `enablePniKeys: true`.
|
|
214
214
|
- `protocol.postQuantum` and `protocol.braid` are product-facing policy.
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<p id="status" role="status">Ready</p>
|
|
20
20
|
<pre id="output" aria-label="Execution output" tabindex="0"></pre>
|
|
21
21
|
<p>The browser console shows the same results. Ciphertext changes on each run.</p>
|
|
22
|
-
<p><a href="https://github.com/open-e2ee/signal-protocol-js/tree/
|
|
22
|
+
<p><a href="https://github.com/open-e2ee/signal-protocol-js/tree/v4.0.0/examples/browser/src/exchange.ts">Read the exchange code</a> · <a href="https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v4.0.0/examples/browser">Edit on StackBlitz</a></p>
|
|
23
23
|
<p>Continue with <a href="https://docs.open-e2ee.dev/start/browser">browser storage</a>, <a href="https://docs.open-e2ee.dev/start/expo">Expo / Hermes setup</a>, or <a href="https://open-e2ee.dev/relay">the OpenE2EE Signal Protocol Relay for separate devices</a>.</p>
|
|
24
24
|
</main>
|
|
25
25
|
<script type="module" src="/src/main.ts"></script>
|
package/groups/README.md
CHANGED
|
@@ -18,13 +18,13 @@ and sender-key rotation.
|
|
|
18
18
|
import {
|
|
19
19
|
GroupManager,
|
|
20
20
|
createGroupId,
|
|
21
|
-
type
|
|
22
|
-
type
|
|
21
|
+
type GroupServer,
|
|
22
|
+
type GroupStateStore,
|
|
23
23
|
} from "@open-e2ee/signal-protocol-sdk/groups";
|
|
24
24
|
|
|
25
25
|
const groups = new GroupManager({
|
|
26
|
-
store: appGroupStore as
|
|
27
|
-
server: appGroupServer as
|
|
26
|
+
store: appGroupStore as GroupStateStore,
|
|
27
|
+
server: appGroupServer as GroupServer,
|
|
28
28
|
issueCredential: () => appGroupCredentials.issue(),
|
|
29
29
|
credentialPublicKey,
|
|
30
30
|
serverSigningPublicKey,
|
package/local/store/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Storage Guide
|
|
2
2
|
|
|
3
|
-
> Infrastructure | Implements `
|
|
3
|
+
> Infrastructure | Implements `SignalProtocolLocalStore` | [Architecture](../../ARCHITECTURE.md)
|
|
4
4
|
|
|
5
5
|
The storage layer owns device-local Signal Protocol state: identity keys,
|
|
6
6
|
contact trust, prekeys, sessions, and retry/message-record metadata.
|
|
@@ -8,7 +8,7 @@ contact trust, prekeys, sessions, and retry/message-record metadata.
|
|
|
8
8
|
## Why it exists
|
|
9
9
|
|
|
10
10
|
Protocol state must survive restarts and several security transitions must
|
|
11
|
-
commit atomically. `
|
|
11
|
+
commit atomically. `SignalProtocolLocalStore` makes those requirements explicit
|
|
12
12
|
without coupling the client to a database or platform.
|
|
13
13
|
|
|
14
14
|
## Current Support
|
|
@@ -50,7 +50,7 @@ exported backend-conformance kit described in the
|
|
|
50
50
|
|
|
51
51
|
The experimental label comes off an adapter when every item below is a named,
|
|
52
52
|
continuously running CI gate. Each gate tests the adapter's own contract,
|
|
53
|
-
which is the set of promises `
|
|
53
|
+
which is the set of promises `SignalProtocolLocalStore` makes. No gate tests
|
|
54
54
|
the platform under it. Browsers, IndexedDB, and React Native are the
|
|
55
55
|
environment an adapter must honor its promises in, not the subject of a test.
|
|
56
56
|
|
|
@@ -144,11 +144,11 @@ state, retry message records, and recovery helpers.
|
|
|
144
144
|
|
|
145
145
|
<!-- doc-snippet:skip requires-external-context -->
|
|
146
146
|
```ts
|
|
147
|
-
import {
|
|
147
|
+
import { DefaultSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
|
|
148
148
|
import { ExpoSignalProtocolStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
|
|
149
149
|
|
|
150
150
|
// Configure the application-owned Expo/SQLCipher database bindings first.
|
|
151
|
-
const signal = await
|
|
151
|
+
const signal = await DefaultSignalProtocolClient.create(userId, {
|
|
152
152
|
storage: new ExpoSignalProtocolStore(),
|
|
153
153
|
});
|
|
154
154
|
```
|
|
@@ -157,7 +157,7 @@ The [Expo guide](./expo/README.md) shows the required database bootstrap.
|
|
|
157
157
|
|
|
158
158
|
## Storage Responsibilities
|
|
159
159
|
|
|
160
|
-
An `
|
|
160
|
+
An `SignalProtocolLocalStore` implementation must preserve:
|
|
161
161
|
|
|
162
162
|
- account identity key storage
|
|
163
163
|
- contact identity trust / TOFU decisions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Expo Store
|
|
2
2
|
|
|
3
|
-
`ExpoSignalProtocolStore` implements `
|
|
3
|
+
`ExpoSignalProtocolStore` implements `SignalProtocolLocalStore` for Expo and React Native with
|
|
4
4
|
an application-owned SQLite/Drizzle database and a database key held through
|
|
5
5
|
the local secret-vault boundary.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# In-Memory Store
|
|
2
2
|
|
|
3
|
-
`InMemorySignalProtocolStore` implements `
|
|
3
|
+
`InMemorySignalProtocolStore` implements `SignalProtocolLocalStore` in memory for examples, local
|
|
4
4
|
development, and deterministic application prototypes.
|
|
5
5
|
|
|
6
6
|
The protocol and cryptography are real. The adapter simulates the
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
`NodeSignalProtocolStore` provides Node.js protocol storage using encrypted,
|
|
4
4
|
crash-durable filesystem state.
|
|
5
5
|
|
|
6
|
-
It implements all of `
|
|
6
|
+
It implements all of `SignalProtocolLocalStore`. That covers identity,
|
|
7
7
|
prekeys, sessions, Kyber prekeys, Sesame device records, sender keys, and
|
|
8
8
|
message records. Multi-device and group flows therefore work in Node without a
|
|
9
9
|
custom adapter.
|
|
10
10
|
|
|
11
|
-
The class declares `implements
|
|
11
|
+
The class declares `implements SignalProtocolLocalStore`, so the compiler
|
|
12
12
|
rejects any build that omits a member or changes its signature. That check is
|
|
13
13
|
the guarantee behind this paragraph, not a manual audit.
|
|
14
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Bare React Native Store
|
|
2
2
|
|
|
3
|
-
`ReactNativeSignalProtocolStore` implements `
|
|
3
|
+
`ReactNativeSignalProtocolStore` implements `SignalProtocolLocalStore` for bare React Native
|
|
4
4
|
through an application-provided persistent key-value backend.
|
|
5
5
|
|
|
6
6
|
## Why it exists
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# IndexedDB Store
|
|
2
2
|
|
|
3
|
-
`IndexedDbSignalProtocolStore` implements the full `
|
|
3
|
+
`IndexedDbSignalProtocolStore` implements the full `SignalProtocolLocalStore` contract for web
|
|
4
4
|
browsers using IndexedDB and Web Crypto.
|
|
5
5
|
|
|
6
6
|
## Why it exists
|
package/local/vault/README.md
CHANGED
|
@@ -7,7 +7,7 @@ The local secret vault stores small bootstrap secrets through a minimal
|
|
|
7
7
|
|
|
8
8
|
Platform secret managers are appropriate for tiny keys and bootstrap values,
|
|
9
9
|
but not full session databases. A vault separate from
|
|
10
|
-
`
|
|
10
|
+
`SignalProtocolLocalStore` keeps platform limits explicit. A local store can
|
|
11
11
|
then use a vault-held wrapping key without placing every protocol record in the
|
|
12
12
|
platform keychain.
|
|
13
13
|
|
package/package.json
CHANGED
package/remote/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Remote Guide
|
|
2
2
|
|
|
3
|
-
> Infrastructure | Implements `
|
|
3
|
+
> Infrastructure | Implements `SignalProtocolRelayServer` and `SignalProtocolRemoteObjectStore` | [Architecture](../ARCHITECTURE.md)
|
|
4
4
|
|
|
5
5
|
The backend layer is responsible for server-owned protocol state: public
|
|
6
6
|
prekeys, device registration, encrypted-envelope delivery, and provisioning
|
|
@@ -19,7 +19,7 @@ replaceable and prevent them from owning private keys or plaintext.
|
|
|
19
19
|
|
|
20
20
|
- the OpenE2EE Signal Protocol Relay through `createHostedSignalProtocolClient()` from the package root
|
|
21
21
|
- `InMemorySignalProtocolRelayServer` from `@open-e2ee/signal-protocol-sdk/remote/relay/memory`
|
|
22
|
-
- custom implementations via `
|
|
22
|
+
- custom implementations via `SignalProtocolRelayServer`
|
|
23
23
|
|
|
24
24
|
### Remote object store
|
|
25
25
|
|
|
@@ -51,7 +51,7 @@ const signal = await createHostedSignalProtocolClient({
|
|
|
51
51
|
|
|
52
52
|
## Relay Responsibilities
|
|
53
53
|
|
|
54
|
-
An `
|
|
54
|
+
An `SignalProtocolRelayServer` implementation must preserve the package’s protocol semantics for:
|
|
55
55
|
|
|
56
56
|
- identity and prekey upload
|
|
57
57
|
- prekey bundle fetch
|
|
@@ -98,11 +98,11 @@ create, download, completion, and deletion.
|
|
|
98
98
|
|
|
99
99
|
<!-- doc-snippet:skip requires-external-context -->
|
|
100
100
|
```ts
|
|
101
|
-
import {
|
|
101
|
+
import { DefaultSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
102
102
|
import { convexR2ObjectStore } from "@open-e2ee/signal-protocol-sdk/remote/object-store/convex-r2";
|
|
103
103
|
import { api } from "../convex/_generated/api";
|
|
104
104
|
|
|
105
|
-
const signal = await
|
|
105
|
+
const signal = await DefaultSignalProtocolClient.create(userId, {
|
|
106
106
|
storage,
|
|
107
107
|
relay,
|
|
108
108
|
remoteObjectStore: convexR2ObjectStore({
|
|
@@ -201,18 +201,18 @@ Use `InMemorySignalProtocolRelayServer` when multiple clients need a shared in-m
|
|
|
201
201
|
<!-- doc-snippet:run remote-shared-memory-relay expect="" -->
|
|
202
202
|
```ts
|
|
203
203
|
// Real protocol and cryptography; simulated in-memory infrastructure.
|
|
204
|
-
import {
|
|
204
|
+
import { DefaultSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
|
|
205
205
|
import { InMemorySignalProtocolRelayServer } from "@open-e2ee/signal-protocol-sdk/remote/relay/memory";
|
|
206
206
|
import { InMemorySignalProtocolStore } from "@open-e2ee/signal-protocol-sdk/local/store/memory";
|
|
207
207
|
|
|
208
208
|
const relay = new InMemorySignalProtocolRelayServer();
|
|
209
209
|
|
|
210
|
-
const alice = await
|
|
210
|
+
const alice = await DefaultSignalProtocolClient.create("alice", {
|
|
211
211
|
storage: new InMemorySignalProtocolStore(),
|
|
212
212
|
relay,
|
|
213
213
|
});
|
|
214
214
|
|
|
215
|
-
const bob = await
|
|
215
|
+
const bob = await DefaultSignalProtocolClient.create("bob", {
|
|
216
216
|
storage: new InMemorySignalProtocolStore(),
|
|
217
217
|
relay,
|
|
218
218
|
});
|
package/remote/relay/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Relay
|
|
2
2
|
|
|
3
|
-
The relay module defines `
|
|
3
|
+
The relay module defines `SignalProtocolRelayServer`, the application-backend contract
|
|
4
4
|
for device discovery, public prekeys, encrypted envelopes, key rotation,
|
|
5
5
|
provisioning, and related synchronization.
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ await client.syncToServer();
|
|
|
32
32
|
|
|
33
33
|
For production, connect to the OpenE2EE Signal Protocol Relay through
|
|
34
34
|
`createHostedSignalProtocolClient()` from the package root, or implement
|
|
35
|
-
`
|
|
35
|
+
`SignalProtocolRelayServer` against your own backend. That backend must authenticate
|
|
36
36
|
mutations, allocate linked-device IDs, consume one-time prekeys atomically,
|
|
37
37
|
enforce access policy, and store only encrypted envelopes plus required routing
|
|
38
38
|
metadata.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# In-Memory Relay
|
|
2
2
|
|
|
3
|
-
`InMemorySignalProtocolRelayServer` implements `
|
|
3
|
+
`InMemorySignalProtocolRelayServer` implements `SignalProtocolRelayServer` in memory for examples
|
|
4
4
|
and local application development.
|
|
5
5
|
|
|
6
6
|
The protocol and cryptography are real. The adapter simulates the
|
package/types/README.md
CHANGED
|
@@ -15,8 +15,8 @@ contracts they validate.
|
|
|
15
15
|
<!-- doc-snippet:skip requires-external-context -->
|
|
16
16
|
```ts
|
|
17
17
|
import type {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
SignalProtocolLocalStore,
|
|
19
|
+
SignalProtocolClient,
|
|
20
20
|
SignalProtocolConfig,
|
|
21
21
|
} from "@open-e2ee/signal-protocol-sdk/types";
|
|
22
22
|
import { ProtocolAddress } from "@open-e2ee/signal-protocol-sdk/types/address";
|