@kumiai/mls 0.10.8 → 0.10.9
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/credential.d.ts +10 -0
- package/lib/group-handle.js +8 -1
- package/package.json +1 -1
package/lib/credential.d.ts
CHANGED
|
@@ -62,6 +62,16 @@ export type GroupMember = {
|
|
|
62
62
|
controller?: string;
|
|
63
63
|
/** For a bound leaf: the controller's advisory folded log beacon, when one has been announced. */
|
|
64
64
|
controllerBeacon?: ControllerBeacon;
|
|
65
|
+
/**
|
|
66
|
+
* Names the KeyPackage this leaf was Added from (its leaf node's HPKE key), present only while
|
|
67
|
+
* the leaf still holds that KeyPackage's leaf node — until the member's own first path or
|
|
68
|
+
* Update replaces it. Absent on a leaf that entered by external commit.
|
|
69
|
+
*
|
|
70
|
+
* Only an Add puts a KeyPackage leaf node into the tree, so a value present after a commit and
|
|
71
|
+
* absent before it means the commit Added a leaf — including an Add of a DID the group already
|
|
72
|
+
* held (a stale-leaf replacement), which an `id` diff cannot see.
|
|
73
|
+
*/
|
|
74
|
+
admission?: string;
|
|
65
75
|
};
|
|
66
76
|
export declare function parseMLSCredentialIdentity(identity: Uint8Array): MLSCredentialIdentity;
|
|
67
77
|
/**
|
package/lib/group-handle.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assertTimeClaimsValid, decodeSignedToken, normalizeDID } from '@kokuin/token';
|
|
2
|
+
import { toB64 } from '@sozai/codec';
|
|
2
3
|
import { EventEmitter } from '@sozai/event';
|
|
3
|
-
import { contentTypes, createApplicationMessage, createProposal, decode, defaultCredentialTypes, defaultKeyRetentionConfig, defaultProposalTypes, encode, isDefaultCredential, mlsExporter, mlsMessageDecoder, mlsMessageEncoder, processMessage as mlsProcessMessage, nodeTypes, senderTypes, UsageError, wireformats } from 'ts-mls';
|
|
4
|
+
import { contentTypes, createApplicationMessage, createProposal, decode, defaultCredentialTypes, defaultKeyRetentionConfig, defaultProposalTypes, encode, isDefaultCredential, leafNodeSources, mlsExporter, mlsMessageDecoder, mlsMessageEncoder, processMessage as mlsProcessMessage, nodeTypes, senderTypes, UsageError, wireformats } from 'ts-mls';
|
|
4
5
|
import { readGroupAnchor } from './anchor.js';
|
|
5
6
|
import { verifyLeafCredential } from './authentication.js';
|
|
6
7
|
import { encodeClientState } from './codec.js';
|
|
@@ -673,6 +674,9 @@ function ledgerLogEntry(entryID, token, verified) {
|
|
|
673
674
|
// trusts the host's own persisted state, so neither gate runs on that path.
|
|
674
675
|
const controller = parsed.controller ? parsed.controller.id : undefined;
|
|
675
676
|
const beacon = controller != null ? beaconOf(this.#registry, controller) : undefined;
|
|
677
|
+
// A KeyPackage leaf node is unique to its KeyPackage by its fresh HPKE key, and stays
|
|
678
|
+
// in the tree only until the member's own path or Update replaces it.
|
|
679
|
+
const admission = node.leaf.leafNodeSource === leafNodeSources.key_package ? toB64(node.leaf.hpkePublicKey) : undefined;
|
|
676
680
|
yield {
|
|
677
681
|
leafIndex: i / 2,
|
|
678
682
|
id: parsed.id,
|
|
@@ -682,6 +686,9 @@ function ledgerLogEntry(entryID, token, verified) {
|
|
|
682
686
|
} : {},
|
|
683
687
|
...beacon ? {
|
|
684
688
|
controllerBeacon: beacon
|
|
689
|
+
} : {},
|
|
690
|
+
...admission != null ? {
|
|
691
|
+
admission
|
|
685
692
|
} : {}
|
|
686
693
|
};
|
|
687
694
|
}
|