@kumiai/mls-rpc 0.13.2 → 0.13.3
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/mls.js +1 -1
- package/lib/recovery.d.ts +3 -3
- package/lib/recovery.js +6 -5
- package/package.json +3 -3
package/lib/mls.js
CHANGED
|
@@ -321,7 +321,7 @@ export async function deriveRecoverySecret(handle) {
|
|
|
321
321
|
group: rejoined.group,
|
|
322
322
|
registry: rejoined.knownRegistry,
|
|
323
323
|
signer: reply.signer,
|
|
324
|
-
now: runtime.now
|
|
324
|
+
now: runtime.now
|
|
325
325
|
})) return null;
|
|
326
326
|
const judge = createVerdictJudge({
|
|
327
327
|
now: runtime.now,
|
package/lib/recovery.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type OwnIdentity } from '@kokuin/token';
|
|
2
2
|
import { type ClientState, type ControllerBinding, type DeviceRegistry, type GroupHandle } from '@kumiai/mls';
|
|
3
3
|
import type { OpenedRecoveryVerdict, PendingRecovery, PendingRecoveryConfirmationKeyParams } from '@kumiai/rpc';
|
|
4
|
-
import {
|
|
4
|
+
import type { Now } from '@sozai/runtime';
|
|
5
5
|
export type RecoveryBindingRequest = {
|
|
6
6
|
groupID: string;
|
|
7
7
|
controllerID: string;
|
|
@@ -14,7 +14,7 @@ export type RecoveryReply = {
|
|
|
14
14
|
signer: string;
|
|
15
15
|
};
|
|
16
16
|
export type VerdictJudgeParams = {
|
|
17
|
-
now
|
|
17
|
+
now: Now;
|
|
18
18
|
group: GroupHandle;
|
|
19
19
|
sourceTree: ClientState['ratchetTree'];
|
|
20
20
|
known: DeviceRegistry;
|
|
@@ -29,7 +29,7 @@ export type RecoveryCandidate = PendingRecovery & {
|
|
|
29
29
|
replyLedger: Array<string>;
|
|
30
30
|
signer: string;
|
|
31
31
|
};
|
|
32
|
-
export declare function createRecoveryBindingState(identity: OwnIdentity, host
|
|
32
|
+
export declare function createRecoveryBindingState(identity: OwnIdentity, host: RecoveryBinding | undefined, now: Now): {
|
|
33
33
|
prepare(group: GroupHandle): Promise<"ready" | "renewal-required">;
|
|
34
34
|
join(group: GroupHandle, reply: RecoveryReply): Promise<{
|
|
35
35
|
markBindingUnusable: () => void;
|
package/lib/recovery.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { normalizeDID } from '@kokuin/token';
|
|
2
2
|
import { assertRecoveryBinding, assertRetainsKnownEffects, confirmationKey, confirmationTag, joinGroupExternal, LeafBindingError, LeafLapsedError, parseMLSCredentialIdentity, RevokeProofError, recoverySignerEligible } from '@kumiai/mls';
|
|
3
|
-
|
|
4
|
-
export function createRecoveryBindingState(identity, host, now = createRuntime().now) {
|
|
3
|
+
export function createRecoveryBindingState(identity, host, now) {
|
|
5
4
|
let binding;
|
|
6
5
|
let asked = false;
|
|
7
6
|
let prepared = false;
|
|
@@ -27,6 +26,7 @@ export function createRecoveryBindingState(identity, host, now = createRuntime()
|
|
|
27
26
|
if (unusable.has(bindingID(candidate))) return false;
|
|
28
27
|
try {
|
|
29
28
|
await assertRecoveryBinding({
|
|
29
|
+
now,
|
|
30
30
|
group,
|
|
31
31
|
identity,
|
|
32
32
|
controller: candidate
|
|
@@ -83,6 +83,7 @@ export function createRecoveryBindingState(identity, host, now = createRuntime()
|
|
|
83
83
|
const build = (controller)=>{
|
|
84
84
|
signerEligible = group.anchor.controller == null;
|
|
85
85
|
return joinGroupExternal({
|
|
86
|
+
now,
|
|
86
87
|
identity,
|
|
87
88
|
groupInfo: reply.groupInfo,
|
|
88
89
|
credential: group.credential,
|
|
@@ -100,7 +101,7 @@ export function createRecoveryBindingState(identity, host, now = createRuntime()
|
|
|
100
101
|
group: pending,
|
|
101
102
|
registry: source.registry,
|
|
102
103
|
signer: reply.signer,
|
|
103
|
-
now
|
|
104
|
+
now
|
|
104
105
|
})) throw new Error('Ineligible recovery attestation signer');
|
|
105
106
|
signerEligible = true;
|
|
106
107
|
candidateSource = source;
|
|
@@ -147,7 +148,7 @@ export function createRecoveryBindingState(identity, host, now = createRuntime()
|
|
|
147
148
|
};
|
|
148
149
|
}
|
|
149
150
|
export function createVerdictJudge(params) {
|
|
150
|
-
const { group, sourceTree, known, requestID, now
|
|
151
|
+
const { group, sourceTree, known, requestID, now } = params;
|
|
151
152
|
let tuple;
|
|
152
153
|
return {
|
|
153
154
|
async confirmationKey ({ position, commitDigest }) {
|
|
@@ -175,7 +176,7 @@ export function createVerdictJudge(params) {
|
|
|
175
176
|
group,
|
|
176
177
|
registry: known,
|
|
177
178
|
signer,
|
|
178
|
-
now
|
|
179
|
+
now
|
|
179
180
|
}) ? 'authoritative' : 'advisory';
|
|
180
181
|
if (verdict.verdict === 'confirmed') return 'authoritative';
|
|
181
182
|
for (const node of sourceTree){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumiai/mls-rpc",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"description": "The @kumiai/rpc consumer ports (GroupCrypto, GroupMLS) implemented over @kumiai/mls",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mls",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@kokuin/token": "^0.7.1",
|
|
29
|
-
"@kumiai/mls": "^0.13.
|
|
29
|
+
"@kumiai/mls": "^0.13.4",
|
|
30
30
|
"@kumiai/rpc": "^0.13.2",
|
|
31
31
|
"@noble/ciphers": "^2.4.0",
|
|
32
32
|
"@sozai/runtime": "^0.1.1"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@kumiai/rpc-conformance": "^0.13.0",
|
|
36
36
|
"ts-mls": "2.0.0-rc.13",
|
|
37
|
-
"vitest": "^5.1.
|
|
37
|
+
"vitest": "^5.1.2"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|