@kumiai/mls 0.10.0 → 0.10.1
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/lib/anchor.d.ts +10 -4
- package/lib/anchor.js +26 -2
- package/lib/authentication.d.ts +11 -14
- package/lib/authentication.js +127 -86
- package/lib/capability.d.ts +37 -0
- package/lib/capability.js +141 -0
- package/lib/device-proof.d.ts +1 -0
- package/lib/device-proof.js +8 -12
- package/lib/envelope-fold.d.ts +16 -1
- package/lib/envelope-fold.js +49 -9
- package/lib/errors.d.ts +18 -0
- package/lib/errors.js +33 -0
- package/lib/group-commit.d.ts +22 -35
- package/lib/group-commit.js +122 -103
- package/lib/group-context.d.ts +6 -2
- package/lib/group-context.js +11 -4
- package/lib/group-create.js +56 -11
- package/lib/group-credential.d.ts +3 -1
- package/lib/group-credential.js +17 -3
- package/lib/group-device.js +34 -21
- package/lib/group-handle.d.ts +21 -8
- package/lib/group-handle.js +207 -56
- package/lib/group-lifecycle.d.ts +32 -0
- package/lib/group-lifecycle.js +300 -0
- package/lib/group-membership.js +7 -3
- package/lib/group-welcome.d.ts +11 -2
- package/lib/group-welcome.js +113 -21
- package/lib/group.d.ts +2 -1
- package/lib/group.js +1 -0
- package/lib/history.d.ts +6 -0
- package/lib/history.js +26 -0
- package/lib/index.d.ts +10 -4
- package/lib/index.js +8 -2
- package/lib/lifecycle-proof.d.ts +24 -0
- package/lib/lifecycle-proof.js +193 -0
- package/lib/lifecycle.d.ts +44 -0
- package/lib/lifecycle.js +385 -0
- package/lib/policy.d.ts +20 -0
- package/lib/policy.js +7 -4
- package/lib/recovery-verdict.d.ts +43 -0
- package/lib/recovery-verdict.js +135 -0
- package/lib/recovery.d.ts +70 -0
- package/lib/recovery.js +110 -36
- package/lib/registry.d.ts +34 -7
- package/lib/registry.js +113 -15
- package/lib/roster.d.ts +1 -1
- package/lib/roster.js +2 -2
- package/lib/types.d.ts +13 -8
- package/package.json +4 -4
package/lib/roster.js
CHANGED
|
@@ -12,7 +12,7 @@ import { foldLedger } from './fold.js';
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Self-referential role reducer. Authority is rooted at the genesis anchor (the
|
|
15
|
-
* creator is the epoch-0 admin) and grows only through admins-so-far: every
|
|
15
|
+
* controller or creator is the epoch-0 admin) and grows only through admins-so-far: every
|
|
16
16
|
* grant or demotion must be issued by a DID already an admin in the state
|
|
17
17
|
* accumulated from strictly-earlier entries. That state-so-far check is what
|
|
18
18
|
* makes rotation sound — an admin can demote the very admin that promoted them
|
|
@@ -26,7 +26,7 @@ import { foldLedger } from './fold.js';
|
|
|
26
26
|
seed: (anchor)=>({
|
|
27
27
|
roles: new Map([
|
|
28
28
|
[
|
|
29
|
-
normalizeDID(anchor.creatorDID),
|
|
29
|
+
normalizeDID(anchor.controller ?? anchor.creatorDID),
|
|
30
30
|
'admin'
|
|
31
31
|
]
|
|
32
32
|
])
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { Capabilities, CryptoProvider, GroupContextExtension, IncomingMessageCallback, KeyPackage, PrivateKeyPackage } from 'ts-mls';
|
|
2
|
+
import type { ControllerBinding } from './credential.js';
|
|
2
3
|
import type { VerifiedLedgerEntry } from './ledger.js';
|
|
3
4
|
export type GroupOptions = {
|
|
5
|
+
/** Creator or key-package leaf binding. Creates a lifecycle group when passed to createGroup. */
|
|
6
|
+
controller?: ControllerBinding;
|
|
7
|
+
/** Lifecycle leaf lifetime in seconds. Defaults to 86,400; maximum 604,800. */
|
|
8
|
+
leafLifetime?: number;
|
|
9
|
+
/** Lifecycle trusted grant lifetime in seconds. Defaults to 2,592,000; maximum 31,536,000. */
|
|
10
|
+
trustedGrantLifetime?: number;
|
|
4
11
|
/** Custom CryptoProvider for ts-mls. Defaults to nobleCryptoProvider. */
|
|
5
12
|
cryptoProvider?: CryptoProvider;
|
|
6
13
|
/** Ciphersuite name. Defaults to MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519. */
|
|
@@ -19,13 +26,9 @@ export type GroupOptions = {
|
|
|
19
26
|
* 'reject' to refuse it (the handle stays at its pre-commit epoch and
|
|
20
27
|
* processMessage throws CommitRejectedError). Overridable per call.
|
|
21
28
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* enforcement for the resulting handle; only the decode/fold hard-reject
|
|
26
|
-
* still applies. Callers who want to extend rather than replace the default
|
|
27
|
-
* policy must call defaultCommitPolicy themselves from within their own
|
|
28
|
-
* callback.
|
|
29
|
+
* Replaces the default role rules after mandatory credential and lifecycle gates accept.
|
|
30
|
+
* A caller policy cannot admit a change rejected by those gates. To extend the default
|
|
31
|
+
* role rules, call defaultCommitPolicy from the callback.
|
|
29
32
|
*/
|
|
30
33
|
commitPolicy?: IncomingMessageCallback;
|
|
31
34
|
/**
|
|
@@ -47,10 +50,12 @@ export type GroupOptions = {
|
|
|
47
50
|
export type Invite = {
|
|
48
51
|
/** Group ID the invite is for */
|
|
49
52
|
groupID: string;
|
|
53
|
+
/** Intended recipient DID. */
|
|
54
|
+
recipientDID: string;
|
|
50
55
|
/** Inviter's DID */
|
|
51
56
|
inviterID: string;
|
|
52
57
|
/** The group's whole signed control ledger, in application order, so the joiner
|
|
53
|
-
* folds the same
|
|
58
|
+
* folds the same control state as everyone else. */
|
|
54
59
|
ledgerEntries: Array<string>;
|
|
55
60
|
};
|
|
56
61
|
export type KeyPackageBundle = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumiai/mls",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "E2EE group identity and membership for Enkaku using MLS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mls",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"lib/*"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@kokuin/capability": "^0.3.
|
|
28
|
+
"@kokuin/capability": "^0.3.1",
|
|
29
29
|
"@kokuin/controller": "^0.1.0",
|
|
30
30
|
"@kokuin/token": "^0.5.0",
|
|
31
31
|
"@noble/ciphers": "^2.4.0",
|
|
32
32
|
"@noble/curves": "^2.4.0",
|
|
33
33
|
"@noble/hashes": "^2.4.0",
|
|
34
|
-
"@sozai/codec": "^0.4.
|
|
35
|
-
"@sozai/event": "^0.1.
|
|
34
|
+
"@sozai/codec": "^0.4.2",
|
|
35
|
+
"@sozai/event": "^0.1.5",
|
|
36
36
|
"@sozai/runtime": "^0.1.0",
|
|
37
37
|
"ts-mls": "2.0.0-rc.13"
|
|
38
38
|
},
|