@interop/was-client 0.53.0 → 0.55.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/README.md +70 -14
- package/dist/WasClient.d.ts +1 -1
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +5 -18
- package/dist/WasClient.js.map +1 -1
- package/dist/edv/acquire.d.ts +98 -0
- package/dist/edv/acquire.d.ts.map +1 -0
- package/dist/edv/acquire.js +130 -0
- package/dist/edv/acquire.js.map +1 -0
- package/dist/edv/index.d.ts +35 -2
- package/dist/edv/index.d.ts.map +1 -1
- package/dist/edv/index.js +34 -2
- package/dist/edv/index.js.map +1 -1
- package/dist/edv/refresh.d.ts +62 -0
- package/dist/edv/refresh.d.ts.map +1 -0
- package/dist/edv/refresh.js +69 -0
- package/dist/edv/refresh.js.map +1 -0
- package/dist/edv/refreshingDocCipher.d.ts +70 -0
- package/dist/edv/refreshingDocCipher.d.ts.map +1 -0
- package/dist/edv/refreshingDocCipher.js +110 -0
- package/dist/edv/refreshingDocCipher.js.map +1 -0
- package/dist/errors.d.ts +4 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -3
- package/dist/errors.js.map +1 -1
- package/dist/identity/agents.d.ts +84 -0
- package/dist/identity/agents.d.ts.map +1 -0
- package/dist/identity/agents.js +104 -0
- package/dist/identity/agents.js.map +1 -0
- package/dist/identity/index.d.ts +15 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +14 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/identity/keyResolver.d.ts +30 -0
- package/dist/identity/keyResolver.d.ts.map +1 -0
- package/dist/identity/keyResolver.js +25 -0
- package/dist/identity/keyResolver.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/sync/index.d.ts +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/port.d.ts +5 -1
- package/dist/sync/port.d.ts.map +1 -1
- package/dist/sync/port.js +27 -11
- package/dist/sync/port.js.map +1 -1
- package/dist/sync/predicates.d.ts +21 -4
- package/dist/sync/predicates.d.ts.map +1 -1
- package/dist/sync/predicates.js +23 -4
- package/dist/sync/predicates.js.map +1 -1
- package/dist/sync/provisioning.d.ts +13 -5
- package/dist/sync/provisioning.d.ts.map +1 -1
- package/dist/sync/provisioning.js +13 -7
- package/dist/sync/provisioning.js.map +1 -1
- package/dist/sync/types.d.ts +23 -14
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/zcapClient.d.ts +19 -0
- package/dist/zcapClient.d.ts.map +1 -0
- package/dist/zcapClient.js +32 -0
- package/dist/zcapClient.js.map +1 -0
- package/package.json +9 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/edv/refresh.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAEH;;;;;;GAMG;AACH,qBAAa,uBAAuB;;gBAKtB,EACV,OAAO,EACR,EAAE;QACD,OAAO,EAAE,CAAC,OAAO,EAAE;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAC9D;IAID;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;IAIlE;;;;;;;;;;;OAWG;IACG,eAAe,CAAC,CAAC,EAAE,EACvB,YAAY,EACZ,IAAI,EACL,EAAE;QACD,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,EAAE,MAAM,OAAO,CAAC;YAAE,KAAK,EAAE,CAAC,CAAC;YAAC,YAAY,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;KACzD,GAAG,OAAO,CAAC,CAAC,CAAC;IAUd;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAOjD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The unknown-epoch refresh policy: an epoch rotation emits no change-feed
|
|
6
|
+
* entry, so a cipher built from a cached descriptor can meet envelopes stamped
|
|
7
|
+
* with an epoch it has never seen. The remedy is one re-read of the
|
|
8
|
+
* Collection Description plus a cipher rebuild and a single retry -- and the
|
|
9
|
+
* policy guards that remedy to ONCE per collection per session, so a
|
|
10
|
+
* genuinely foreign envelope (one no descriptor will ever route) cannot drive
|
|
11
|
+
* a refetch loop, let alone a refetch per resource.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Tracks which collections have already spent their one refresh this session,
|
|
15
|
+
* and runs reads under the refresh-and-retry-once rule. One instance per
|
|
16
|
+
* session (it IS the session scope of the guard); the injected `refresh` does
|
|
17
|
+
* the host's whole swap -- re-acquire the descriptor(s), rebuild the
|
|
18
|
+
* cipher(s), and install them wherever the host keeps them.
|
|
19
|
+
*/
|
|
20
|
+
export class DescriptorRefreshPolicy {
|
|
21
|
+
#refresh;
|
|
22
|
+
// Collection ids whose one refresh this session is already spent.
|
|
23
|
+
#refreshed = new Set();
|
|
24
|
+
constructor({ refresh }) {
|
|
25
|
+
this.#refresh = refresh;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Whether a collection still has its one refresh this session.
|
|
29
|
+
*/
|
|
30
|
+
shouldRefresh({ collectionId }) {
|
|
31
|
+
return !this.#refreshed.has(collectionId);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Runs a read that reports whether it skipped unknown-epoch rows; on the
|
|
35
|
+
* first such report for a collection this session, spends the collection's
|
|
36
|
+
* refresh (descriptor re-read + cipher swap, via the injected `refresh`) and
|
|
37
|
+
* re-reads once. A later unknown-epoch report for the same collection
|
|
38
|
+
* returns the read's value as-is.
|
|
39
|
+
*
|
|
40
|
+
* @param options {object}
|
|
41
|
+
* @param options.collectionId {string}
|
|
42
|
+
* @param options.read {function} the read, reporting `unknownEpoch`
|
|
43
|
+
* @returns {Promise<T>} the (possibly re-read) value
|
|
44
|
+
*/
|
|
45
|
+
async readWithRefresh({ collectionId, read }) {
|
|
46
|
+
const first = await read();
|
|
47
|
+
if (first.unknownEpoch && this.shouldRefresh({ collectionId })) {
|
|
48
|
+
this.#refreshed.add(collectionId);
|
|
49
|
+
await this.#refresh({ collectionId });
|
|
50
|
+
return (await read()).value;
|
|
51
|
+
}
|
|
52
|
+
return first.value;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Re-arms the guard -- for one collection, or (with no argument) for all.
|
|
56
|
+
* Call when a fresh descriptor is installed by some other path (a share,
|
|
57
|
+
* unshare, or recipient rotation this session performed itself), since the
|
|
58
|
+
* next unknown-epoch read is then evidence of a NEW rotation elsewhere.
|
|
59
|
+
*/
|
|
60
|
+
reset(options) {
|
|
61
|
+
if (options?.collectionId === undefined) {
|
|
62
|
+
this.#refreshed.clear();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.#refreshed.delete(options.collectionId);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.js","sourceRoot":"","sources":["../../src/edv/refresh.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,uBAAuB;IACzB,QAAQ,CAAsD;IACvE,kEAAkE;IACzD,UAAU,GAAG,IAAI,GAAG,EAAU,CAAA;IAEvC,YAAY,EACV,OAAO,EAGR;QACC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,EAA4B;QACtD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAC3C,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,eAAe,CAAI,EACvB,YAAY,EACZ,IAAI,EAIL;QACC,MAAM,KAAK,GAAG,MAAM,IAAI,EAAE,CAAA;QAC1B,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;YAC/D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;YACjC,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;YACrC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,KAAK,CAAA;QAC7B,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAA;IACpB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAmC;QACvC,IAAI,OAAO,EAAE,YAAY,KAAK,SAAS,EAAE,CAAC;YACxC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;QACzB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A self-refreshing EDV document cipher: `createEdvDocCipher` bound to
|
|
6
|
+
* descriptor acquisition and the once-per-session refresh rule, for a host
|
|
7
|
+
* whose decrypt seam is the cipher itself (a sync engine's `decryptDoc`, a
|
|
8
|
+
* conflict resolver) rather than a row-scanning store.
|
|
9
|
+
*
|
|
10
|
+
* Built, the cipher acquires the collection's descriptor (fetch, cache the
|
|
11
|
+
* success, cached fallback whenever the fetch yields none -- see
|
|
12
|
+
* `acquire.ts`) and constructs the underlying EDV cipher from it; with no
|
|
13
|
+
* descriptor, or a descriptor with no epochs, the build refuses fail-closed
|
|
14
|
+
* (every encrypted collection's descriptor carries an epoch roster from
|
|
15
|
+
* provisioning, so the absence can only mean the install has not landed or
|
|
16
|
+
* the host is lying). When a decrypt throws
|
|
17
|
+
* `UnknownEpochError`, the cipher re-acquires the descriptor, rebuilds itself,
|
|
18
|
+
* and retries that decrypt exactly once -- and only once per cipher instance,
|
|
19
|
+
* which the host scopes to one `(profile, collection)` session by dropping
|
|
20
|
+
* its cipher cache when the session ends. A second failure (or any unknown
|
|
21
|
+
* epoch after the one refresh is spent) propagates. A refresh that itself
|
|
22
|
+
* fails does not count as spent -- the original `UnknownEpochError` is
|
|
23
|
+
* rethrown and a later decrypt may try again.
|
|
24
|
+
*
|
|
25
|
+
* Only `UnknownEpochError` drives that refresh, and by design. The client
|
|
26
|
+
* splits the two ways a decrypt can find no key: an epoch the descriptor does
|
|
27
|
+
* not list at all raises `UnknownEpochError`, because a fresher descriptor may
|
|
28
|
+
* well list it; an epoch the descriptor does list but this reader holds no key
|
|
29
|
+
* for raises `KeyUnwrapError` (never a recipient, or removed and the epoch
|
|
30
|
+
* rotated). The second is rethrown immediately, with the refresh left
|
|
31
|
+
* untouched, since re-reading the same descriptor cannot produce a key the
|
|
32
|
+
* reader was not given.
|
|
33
|
+
*/
|
|
34
|
+
import type { IKeyAgreementKey, IKeyResolver } from '@interop/data-integrity-core';
|
|
35
|
+
import { type DocCipher } from './docCipher.js';
|
|
36
|
+
import { type EncryptionDescriptorCache, type EncryptionDescriptorSource } from './acquire.js';
|
|
37
|
+
/**
|
|
38
|
+
* Builds a {@link DocCipher} whose descriptor is acquired through the
|
|
39
|
+
* source/cache seams and refreshed (once per instance) on an unknown-epoch
|
|
40
|
+
* decrypt.
|
|
41
|
+
*
|
|
42
|
+
* With no `source` the descriptor is served from the cache alone and the
|
|
43
|
+
* refresh path is inert (an unknown-epoch decrypt propagates immediately) --
|
|
44
|
+
* the shape for a purely local code path that must never touch the network.
|
|
45
|
+
*
|
|
46
|
+
* @param options {object}
|
|
47
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the vault key pair this
|
|
48
|
+
* collection's envelopes are sealed to
|
|
49
|
+
* @param options.keyResolver {IKeyResolver}
|
|
50
|
+
* @param options.collectionId {string}
|
|
51
|
+
* @param [options.idDerivation] {'content' | 'random'} defaults to
|
|
52
|
+
* `'content'`
|
|
53
|
+
* @param [options.source] {EncryptionDescriptorSource}
|
|
54
|
+
* @param options.cache {EncryptionDescriptorCache}
|
|
55
|
+
* @param [options.onFetchError] {function} observes swallowed
|
|
56
|
+
* descriptor-fetch failures
|
|
57
|
+
* @returns {Promise<DocCipher>}
|
|
58
|
+
*/
|
|
59
|
+
export declare function createRefreshingEdvDocCipher({ keyAgreementKey, keyResolver, collectionId, idDerivation, source, cache, onFetchError }: {
|
|
60
|
+
keyAgreementKey: IKeyAgreementKey;
|
|
61
|
+
keyResolver: IKeyResolver;
|
|
62
|
+
collectionId: string;
|
|
63
|
+
idDerivation?: 'content' | 'random';
|
|
64
|
+
source?: EncryptionDescriptorSource;
|
|
65
|
+
cache: EncryptionDescriptorCache;
|
|
66
|
+
onFetchError?: (err: unknown, info: {
|
|
67
|
+
collectionId: string;
|
|
68
|
+
}) => void;
|
|
69
|
+
}): Promise<DocCipher>;
|
|
70
|
+
//# sourceMappingURL=refreshingDocCipher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshingDocCipher.d.ts","sourceRoot":"","sources":["../../src/edv/refreshingDocCipher.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAChC,MAAM,cAAc,CAAA;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,4BAA4B,CAAC,EACjD,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,YAAY,EACb,EAAE;IACD,eAAe,EAAE,gBAAgB,CAAA;IACjC,WAAW,EAAE,YAAY,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IACnC,MAAM,CAAC,EAAE,0BAA0B,CAAA;IACnC,KAAK,EAAE,yBAAyB,CAAA;IAChC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACtE,GAAG,OAAO,CAAC,SAAS,CAAC,CAyFrB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { UnknownEpochError } from '../errors.js';
|
|
2
|
+
import { createEdvDocCipher } from './docCipher.js';
|
|
3
|
+
import { acquireDescriptor } from './acquire.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds a {@link DocCipher} whose descriptor is acquired through the
|
|
6
|
+
* source/cache seams and refreshed (once per instance) on an unknown-epoch
|
|
7
|
+
* decrypt.
|
|
8
|
+
*
|
|
9
|
+
* With no `source` the descriptor is served from the cache alone and the
|
|
10
|
+
* refresh path is inert (an unknown-epoch decrypt propagates immediately) --
|
|
11
|
+
* the shape for a purely local code path that must never touch the network.
|
|
12
|
+
*
|
|
13
|
+
* @param options {object}
|
|
14
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the vault key pair this
|
|
15
|
+
* collection's envelopes are sealed to
|
|
16
|
+
* @param options.keyResolver {IKeyResolver}
|
|
17
|
+
* @param options.collectionId {string}
|
|
18
|
+
* @param [options.idDerivation] {'content' | 'random'} defaults to
|
|
19
|
+
* `'content'`
|
|
20
|
+
* @param [options.source] {EncryptionDescriptorSource}
|
|
21
|
+
* @param options.cache {EncryptionDescriptorCache}
|
|
22
|
+
* @param [options.onFetchError] {function} observes swallowed
|
|
23
|
+
* descriptor-fetch failures
|
|
24
|
+
* @returns {Promise<DocCipher>}
|
|
25
|
+
*/
|
|
26
|
+
export async function createRefreshingEdvDocCipher({ keyAgreementKey, keyResolver, collectionId, idDerivation, source, cache, onFetchError }) {
|
|
27
|
+
const build = async () => {
|
|
28
|
+
const encryption = await acquireDescriptor({
|
|
29
|
+
source,
|
|
30
|
+
cache,
|
|
31
|
+
collectionId,
|
|
32
|
+
onFetchError
|
|
33
|
+
});
|
|
34
|
+
if (!encryption) {
|
|
35
|
+
throw new Error(`Collection "${collectionId}" has no encryption descriptor available ` +
|
|
36
|
+
'(fetched or cached). Every encrypted collection carries its key ' +
|
|
37
|
+
'epochs from provisioning; refusing to build a cipher without them.');
|
|
38
|
+
}
|
|
39
|
+
return createEdvDocCipher({
|
|
40
|
+
keyAgreementKey,
|
|
41
|
+
keyResolver,
|
|
42
|
+
collectionId,
|
|
43
|
+
idDerivation,
|
|
44
|
+
encryption
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
let inner = await build();
|
|
48
|
+
// The one descriptor refresh this cipher instance (= this collection this
|
|
49
|
+
// session) may spend, shared so concurrent unknown-epoch decrypts ride a
|
|
50
|
+
// single re-read instead of each spending one.
|
|
51
|
+
let refreshed = null;
|
|
52
|
+
return {
|
|
53
|
+
encrypt: options => inner.encrypt(options),
|
|
54
|
+
encryptUpdate: options => {
|
|
55
|
+
if (!inner.encryptUpdate) {
|
|
56
|
+
throw new Error(`Collection "${collectionId}" cipher has no in-place update.`);
|
|
57
|
+
}
|
|
58
|
+
return inner.encryptUpdate(options);
|
|
59
|
+
},
|
|
60
|
+
async decrypt({ envelope }) {
|
|
61
|
+
try {
|
|
62
|
+
return await inner.decrypt({ envelope });
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
// `instanceof` is safe here and only here: `inner` is built in this
|
|
66
|
+
// package by `createEdvDocCipher`, which raises this package's own
|
|
67
|
+
// class, so no injected seam is crossed. A caller classifying what
|
|
68
|
+
// THIS cipher throws is crossing one, and uses `isUnknownEpochError` /
|
|
69
|
+
// `isKeyUnwrapError` instead.
|
|
70
|
+
if (!(err instanceof UnknownEpochError) || !source) {
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
if (!refreshed) {
|
|
74
|
+
const attempt = build().then(cipher => {
|
|
75
|
+
inner = cipher;
|
|
76
|
+
});
|
|
77
|
+
refreshed = attempt;
|
|
78
|
+
// Only a COMPLETED refresh is spent. A rejected one (the description
|
|
79
|
+
// could not be read and no cached copy answered either) un-arms the
|
|
80
|
+
// guard so a later unknown-epoch decrypt may try again; a successful
|
|
81
|
+
// refresh that still cannot route the envelope stays spent for the
|
|
82
|
+
// session, which is what keeps a genuinely foreign envelope from
|
|
83
|
+
// driving a refetch loop.
|
|
84
|
+
attempt.catch(() => {
|
|
85
|
+
if (refreshed === attempt) {
|
|
86
|
+
refreshed = null;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
await refreshed;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// The refresh failed, so nothing was learned about this envelope's
|
|
95
|
+
// epoch: surface the original UnknownEpochError rather than the
|
|
96
|
+
// build failure, so callers classifying on it (the create-loss
|
|
97
|
+
// re-mint) still see the row they exist to repair.
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
// One retry under the swapped cipher. If the refresh was already
|
|
101
|
+
// spent before this decrypt began, this re-attempt is a local
|
|
102
|
+
// no-network decrypt that fails the same way -- so a genuinely
|
|
103
|
+
// foreign envelope still surfaces UnknownEpochError, and never a
|
|
104
|
+
// second description read.
|
|
105
|
+
return inner.decrypt({ envelope });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=refreshingDocCipher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshingDocCipher.js","sourceRoot":"","sources":["../../src/edv/refreshingDocCipher.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAkB,MAAM,gBAAgB,CAAA;AACnE,OAAO,EACL,iBAAiB,EAGlB,MAAM,cAAc,CAAA;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,YAAY,EASb;IACC,MAAM,KAAK,GAAG,KAAK,IAAwB,EAAE;QAC3C,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC;YACzC,MAAM;YACN,KAAK;YACL,YAAY;YACZ,YAAY;SACb,CAAC,CAAA;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,eAAe,YAAY,2CAA2C;gBACpE,kEAAkE;gBAClE,oEAAoE,CACvE,CAAA;QACH,CAAC;QACD,OAAO,kBAAkB,CAAC;YACxB,eAAe;YACf,WAAW;YACX,YAAY;YACZ,YAAY;YACZ,UAAU;SACX,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,IAAI,KAAK,GAAG,MAAM,KAAK,EAAE,CAAA;IACzB,0EAA0E;IAC1E,yEAAyE;IACzE,+CAA+C;IAC/C,IAAI,SAAS,GAAyB,IAAI,CAAA;IAE1C,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAE1C,aAAa,EAAE,OAAO,CAAC,EAAE;YACvB,IAAI,CAAC,KAAK,C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iEAAiE;gBACjE,2BAA2B;gBAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;YACpC,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -174,9 +174,10 @@ export declare class WasSyncConflictError extends PreconditionFailedError {
|
|
|
174
174
|
constructor(message?: string, options?: WasErrorOptions);
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
* The replication-port signal for a delete
|
|
178
|
-
* (HTTP 404). For a delete this is a settled outcome
|
|
179
|
-
* never reached the server)
|
|
177
|
+
* The replication-port signal for a delete or a metadata write whose target
|
|
178
|
+
* resource is absent (HTTP 404). For a delete this is a settled outcome
|
|
179
|
+
* (already gone, or the write never reached the server); for a metadata write
|
|
180
|
+
* it is a race with a remote delete. Neither is a conflict, so a `WasSyncPort`
|
|
180
181
|
* (`@interop/was-client/sync`) raises this distinct type rather than
|
|
181
182
|
* {@link WasSyncConflictError}. A subtype of {@link NotFoundError}.
|
|
182
183
|
*/
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,M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|
package/dist/errors.js
CHANGED
|
@@ -180,9 +180,10 @@ export class WasSyncConflictError extends PreconditionFailedError {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
|
-
* The replication-port signal for a delete
|
|
184
|
-
* (HTTP 404). For a delete this is a settled outcome
|
|
185
|
-
* never reached the server)
|
|
183
|
+
* The replication-port signal for a delete or a metadata write whose target
|
|
184
|
+
* resource is absent (HTTP 404). For a delete this is a settled outcome
|
|
185
|
+
* (already gone, or the write never reached the server); for a metadata write
|
|
186
|
+
* it is a race with a remote delete. Neither is a conflict, so a `WasSyncPort`
|
|
186
187
|
* (`@interop/was-client/sync`) raises this distinct type rather than
|
|
187
188
|
* {@link WasSyncConflictError}. A subtype of {@link NotFoundError}.
|
|
188
189
|
*/
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAmBpD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,MAAM,CAAS;IACf,IAAI,CAAS;IACb,KAAK,CAAS;IACd,OAAO,CAAW;IAClB,UAAU,CAAS;IAEnB,YAAY,OAAe,EAAE,UAA2B,EAAE;QACxD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QACnE,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QAC3D,IAAI,CAAC,IAAI,GAAG,UAAU,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC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KAAK,GAAG;YACN,OAAO,IAAI,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACnD,KAAK,GAAG;YACN,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAClD,KAAK,GAAG;YACN,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QAChD,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;IAED,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* WAS identity derivation: controller secret / seed to the agent set a did:key
|
|
6
|
+
* client operates with. Every consumer must derive byte-for-byte identically,
|
|
7
|
+
* so that supplying the same controller secret on any client joins the same
|
|
8
|
+
* WAS account/Space.
|
|
9
|
+
*
|
|
10
|
+
* The derivation: secret or 32-byte seed enters `CapabilityAgent` under the
|
|
11
|
+
* fixed `'bootstrap'` / `'boostrap-key'` names (the typo is load-bearing --
|
|
12
|
+
* every account's data identity derives through these exact strings, so they
|
|
13
|
+
* can never change without stranding existing accounts). The resulting Ed25519
|
|
14
|
+
* signing key backs a did:key DID, a `ZcapClient` for signing storage
|
|
15
|
+
* requests, and -- via did:key's encryption-key derivation (the Montgomery
|
|
16
|
+
* form of the signing key) -- the X25519 key agreement key (KAK) the EDV
|
|
17
|
+
* DocCipher encrypts and decrypts with. Everything is deterministic: a
|
|
18
|
+
* returning user, on any client, decrypts the same envelopes.
|
|
19
|
+
*/
|
|
20
|
+
import { CapabilityAgent } from '@interop/webkms-client';
|
|
21
|
+
import { ZcapClient } from '@interop/ezcap';
|
|
22
|
+
import type { IKeyAgreementKey, IKeyResolver } from '@interop/data-integrity-core';
|
|
23
|
+
/**
|
|
24
|
+
* The load-bearing `CapabilityAgent` derivation names (see the module doc:
|
|
25
|
+
* the typo in the key name can never be fixed without stranding accounts).
|
|
26
|
+
*/
|
|
27
|
+
export declare const BOOTSTRAP_HANDLE = "bootstrap";
|
|
28
|
+
export declare const BOOTSTRAP_KEY_NAME = "boostrap-key";
|
|
29
|
+
/**
|
|
30
|
+
* The agents derived from a controller secret or seed: the signing
|
|
31
|
+
* CapabilityAgent / did:key, a ZcapClient for signing storage requests, and
|
|
32
|
+
* the X25519 key agreement key (KAK) + resolver used by the EDV DocCipher.
|
|
33
|
+
*/
|
|
34
|
+
export interface ProfileAgents {
|
|
35
|
+
controllerDid: string;
|
|
36
|
+
keyAgent: CapabilityAgent;
|
|
37
|
+
zcapClient: ZcapClient;
|
|
38
|
+
keyAgreementKey: IKeyAgreementKey;
|
|
39
|
+
keyResolver: IKeyResolver;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Derives the WAS agents from an already-derived 32-byte seed, skipping the
|
|
43
|
+
* salted-hash step (`CapabilityAgent.fromSeed` semantics: a stored seed
|
|
44
|
+
* stands in for the original secret).
|
|
45
|
+
*
|
|
46
|
+
* @param options {object}
|
|
47
|
+
* @param options.seed {Uint8Array} the 32-byte seed
|
|
48
|
+
* @returns {Promise<ProfileAgents>}
|
|
49
|
+
*/
|
|
50
|
+
export declare function agentsFromSeed({ seed }: {
|
|
51
|
+
seed: Uint8Array;
|
|
52
|
+
}): Promise<ProfileAgents>;
|
|
53
|
+
/**
|
|
54
|
+
* Derives the WAS agents from a controller secret. The secret is always a
|
|
55
|
+
* string: a passphrase, or the base64url text of 32 random bytes, not the
|
|
56
|
+
* decoded bytes. `CapabilityAgent.fromSecret`'s salted hash is
|
|
57
|
+
* type-sensitive, so a string and its UTF-8 bytes derive different keys.
|
|
58
|
+
* Passing a string keeps every secret typeable/scannable into a login form
|
|
59
|
+
* (the cross-wallet linking flow).
|
|
60
|
+
*
|
|
61
|
+
* @param options {object}
|
|
62
|
+
* @param options.secret {string} the controller secret (see above)
|
|
63
|
+
* @returns {Promise<ProfileAgents>}
|
|
64
|
+
*/
|
|
65
|
+
export declare function agentsFromSecret({ secret }: {
|
|
66
|
+
secret: string;
|
|
67
|
+
}): Promise<ProfileAgents>;
|
|
68
|
+
/**
|
|
69
|
+
* Assembles the derived agents -- signer, `ZcapClient`, key agreement key (the
|
|
70
|
+
* Ed25519-to-X25519 Montgomery conversion), and single-key resolver -- from an
|
|
71
|
+
* already-derived `CapabilityAgent`. The shared tail of both derivations here,
|
|
72
|
+
* and exported because downstream packages derive their own `CapabilityAgent`
|
|
73
|
+
* (from an app seed, under their own handle / key name) and then need this same
|
|
74
|
+
* assembly: keeping it in one place means the Montgomery conversion that every
|
|
75
|
+
* encrypted collection is read with has exactly one implementation.
|
|
76
|
+
*
|
|
77
|
+
* @param options {object}
|
|
78
|
+
* @param options.keyAgent {CapabilityAgent} the derived signing agent
|
|
79
|
+
* @returns {ProfileAgents}
|
|
80
|
+
*/
|
|
81
|
+
export declare function agentsFromKeyAgent({ keyAgent }: {
|
|
82
|
+
keyAgent: CapabilityAgent;
|
|
83
|
+
}): ProfileAgents;
|
|
84
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AAKrC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,cAAc,CAAA;AAC3C,eAAO,MAAM,kBAAkB,iBAAiB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,eAAe,CAAA;IACzB,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,gBAAgB,CAAA;IACjC,WAAW,EAAE,YAAY,CAAA;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACL,EAAE;IACD,IAAI,EAAE,UAAU,CAAA;CACjB,GAAG,OAAO,CAAC,aAAa,CAAC,CAYzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,MAAM,EACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,aAAa,CAAC,CAOzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,eAAe,CAAA;CAC1B,GAAG,aAAa,CAqBhB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* WAS identity derivation: controller secret / seed to the agent set a did:key
|
|
6
|
+
* client operates with. Every consumer must derive byte-for-byte identically,
|
|
7
|
+
* so that supplying the same controller secret on any client joins the same
|
|
8
|
+
* WAS account/Space.
|
|
9
|
+
*
|
|
10
|
+
* The derivation: secret or 32-byte seed enters `CapabilityAgent` under the
|
|
11
|
+
* fixed `'bootstrap'` / `'boostrap-key'` names (the typo is load-bearing --
|
|
12
|
+
* every account's data identity derives through these exact strings, so they
|
|
13
|
+
* can never change without stranding existing accounts). The resulting Ed25519
|
|
14
|
+
* signing key backs a did:key DID, a `ZcapClient` for signing storage
|
|
15
|
+
* requests, and -- via did:key's encryption-key derivation (the Montgomery
|
|
16
|
+
* form of the signing key) -- the X25519 key agreement key (KAK) the EDV
|
|
17
|
+
* DocCipher encrypts and decrypts with. Everything is deterministic: a
|
|
18
|
+
* returning user, on any client, decrypts the same envelopes.
|
|
19
|
+
*/
|
|
20
|
+
import { CapabilityAgent } from '@interop/webkms-client';
|
|
21
|
+
import { ZcapClient } from '@interop/ezcap';
|
|
22
|
+
import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
|
|
23
|
+
import { ValidationError } from '../errors.js';
|
|
24
|
+
import { zcapClientForSigner } from '../zcapClient.js';
|
|
25
|
+
import { singleKeyResolver } from './keyResolver.js';
|
|
26
|
+
/**
|
|
27
|
+
* The load-bearing `CapabilityAgent` derivation names (see the module doc:
|
|
28
|
+
* the typo in the key name can never be fixed without stranding accounts).
|
|
29
|
+
*/
|
|
30
|
+
export const BOOTSTRAP_HANDLE = 'bootstrap';
|
|
31
|
+
export const BOOTSTRAP_KEY_NAME = 'boostrap-key';
|
|
32
|
+
/**
|
|
33
|
+
* Derives the WAS agents from an already-derived 32-byte seed, skipping the
|
|
34
|
+
* salted-hash step (`CapabilityAgent.fromSeed` semantics: a stored seed
|
|
35
|
+
* stands in for the original secret).
|
|
36
|
+
*
|
|
37
|
+
* @param options {object}
|
|
38
|
+
* @param options.seed {Uint8Array} the 32-byte seed
|
|
39
|
+
* @returns {Promise<ProfileAgents>}
|
|
40
|
+
*/
|
|
41
|
+
export async function agentsFromSeed({ seed }) {
|
|
42
|
+
if (seed.length !== 32) {
|
|
43
|
+
throw new ValidationError(`Expected a 32-byte seed, got ${seed.length} bytes.`);
|
|
44
|
+
}
|
|
45
|
+
const keyAgent = await CapabilityAgent.fromSeed({
|
|
46
|
+
seed,
|
|
47
|
+
handle: BOOTSTRAP_HANDLE,
|
|
48
|
+
keyName: BOOTSTRAP_KEY_NAME
|
|
49
|
+
});
|
|
50
|
+
return agentsFromKeyAgent({ keyAgent });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Derives the WAS agents from a controller secret. The secret is always a
|
|
54
|
+
* string: a passphrase, or the base64url text of 32 random bytes, not the
|
|
55
|
+
* decoded bytes. `CapabilityAgent.fromSecret`'s salted hash is
|
|
56
|
+
* type-sensitive, so a string and its UTF-8 bytes derive different keys.
|
|
57
|
+
* Passing a string keeps every secret typeable/scannable into a login form
|
|
58
|
+
* (the cross-wallet linking flow).
|
|
59
|
+
*
|
|
60
|
+
* @param options {object}
|
|
61
|
+
* @param options.secret {string} the controller secret (see above)
|
|
62
|
+
* @returns {Promise<ProfileAgents>}
|
|
63
|
+
*/
|
|
64
|
+
export async function agentsFromSecret({ secret }) {
|
|
65
|
+
const keyAgent = await CapabilityAgent.fromSecret({
|
|
66
|
+
secret,
|
|
67
|
+
handle: BOOTSTRAP_HANDLE,
|
|
68
|
+
keyName: BOOTSTRAP_KEY_NAME
|
|
69
|
+
});
|
|
70
|
+
return agentsFromKeyAgent({ keyAgent });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Assembles the derived agents -- signer, `ZcapClient`, key agreement key (the
|
|
74
|
+
* Ed25519-to-X25519 Montgomery conversion), and single-key resolver -- from an
|
|
75
|
+
* already-derived `CapabilityAgent`. The shared tail of both derivations here,
|
|
76
|
+
* and exported because downstream packages derive their own `CapabilityAgent`
|
|
77
|
+
* (from an app seed, under their own handle / key name) and then need this same
|
|
78
|
+
* assembly: keeping it in one place means the Montgomery conversion that every
|
|
79
|
+
* encrypted collection is read with has exactly one implementation.
|
|
80
|
+
*
|
|
81
|
+
* @param options {object}
|
|
82
|
+
* @param options.keyAgent {CapabilityAgent} the derived signing agent
|
|
83
|
+
* @returns {ProfileAgents}
|
|
84
|
+
*/
|
|
85
|
+
export function agentsFromKeyAgent({ keyAgent }) {
|
|
86
|
+
const signer = keyAgent.getSigner();
|
|
87
|
+
// The root key also signs delegations (sharing grants, app capability
|
|
88
|
+
// grants).
|
|
89
|
+
const zcapClient = zcapClientForSigner({ signer });
|
|
90
|
+
const keyAgreementKey = X25519KeyAgreementKey2020.fromEd25519VerificationKey2020({
|
|
91
|
+
keyPair: keyAgent.getVerificationKeyPair()
|
|
92
|
+
});
|
|
93
|
+
const keyResolver = singleKeyResolver({ keyAgreementKey });
|
|
94
|
+
return {
|
|
95
|
+
controllerDid: keyAgent.id,
|
|
96
|
+
keyAgent,
|
|
97
|
+
zcapClient,
|
|
98
|
+
// `id` is always set on the KAK here (a controller was supplied at
|
|
99
|
+
// derivation), so it satisfies IKeyAgreementKey's required `id`.
|
|
100
|
+
keyAgreementKey: keyAgreementKey,
|
|
101
|
+
keyResolver
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAK7E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAA;AAehD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,IAAI,EAGL;IACC,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,eAAe,CACvB,gCAAgC,IAAI,CAAC,MAAM,SAAS,CACrD,CAAA;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC;QAC9C,IAAI;QACJ,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,kBAAkB;KAC5B,CAAC,CAAA;IACF,OAAO,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;AACzC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,MAAM,EAGP;IACC,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC;QAChD,MAAM;QACN,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,kBAAkB;KAC5B,CAAC,CAAA;IACF,OAAO,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;AACzC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,EAGT;IACC,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAA;IACnC,sEAAsE;IACtE,WAAW;IACX,MAAM,UAAU,GAAG,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IAElD,MAAM,eAAe,GACnB,yBAAyB,CAAC,8BAA8B,CAAC;QACvD,OAAO,EAAE,QAAQ,CAAC,sBAAsB,EAAE;KAC3C,CAAC,CAAA;IACJ,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,eAAe,EAAE,CAAC,CAAA;IAE1D,OAAO;QACL,aAAa,EAAE,QAAQ,CAAC,EAAE;QAC1B,QAAQ;QACR,UAAU;QACV,mEAAmE;QACnE,iEAAiE;QACjE,eAAe,EAAE,eAAmC;QACpD,WAAW;KACZ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The `@interop/was-client/identity` subpath: the did:key data-identity
|
|
6
|
+
* derivation (`agents.ts`, which documents the derivation itself) and the
|
|
7
|
+
* one-key resolver it pairs with (`keyResolver.ts`). Kept off the core entry
|
|
8
|
+
* because it pulls the webkms-client / x25519-key-agreement-key dependency
|
|
9
|
+
* graph. `zcapClientForSigner` is a core export; import it from the package
|
|
10
|
+
* root.
|
|
11
|
+
*/
|
|
12
|
+
export { BOOTSTRAP_HANDLE, BOOTSTRAP_KEY_NAME, agentsFromKeyAgent, agentsFromSecret, agentsFromSeed } from './agents.js';
|
|
13
|
+
export type { ProfileAgents } from './agents.js';
|
|
14
|
+
export { singleKeyResolver } from './keyResolver.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACf,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The `@interop/was-client/identity` subpath: the did:key data-identity
|
|
6
|
+
* derivation (`agents.ts`, which documents the derivation itself) and the
|
|
7
|
+
* one-key resolver it pairs with (`keyResolver.ts`). Kept off the core entry
|
|
8
|
+
* because it pulls the webkms-client / x25519-key-agreement-key dependency
|
|
9
|
+
* graph. `zcapClientForSigner` is a core export; import it from the package
|
|
10
|
+
* root.
|
|
11
|
+
*/
|
|
12
|
+
export { BOOTSTRAP_HANDLE, BOOTSTRAP_KEY_NAME, agentsFromKeyAgent, agentsFromSecret, agentsFromSeed } from './agents.js';
|
|
13
|
+
export { singleKeyResolver } from './keyResolver.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A single-key `IKeyResolver` factory. Key agreement in a wallet-style
|
|
6
|
+
* consumer happens against one known KAK at a time (the vault KAK of the data
|
|
7
|
+
* identity, an unlock KAK of a keyring), so the resolver only ever needs to
|
|
8
|
+
* answer for that one key. Any other key id is an error.
|
|
9
|
+
*/
|
|
10
|
+
import type { IKeyResolver } from '@interop/data-integrity-core';
|
|
11
|
+
/**
|
|
12
|
+
* Builds an `IKeyResolver` that resolves exactly one key -- the supplied key
|
|
13
|
+
* agreement key -- and throws for any other id.
|
|
14
|
+
*
|
|
15
|
+
* @param options {object}
|
|
16
|
+
* @param options.keyAgreementKey {object} the one KAK this resolver answers
|
|
17
|
+
* for; only its `id`, `type`, and `publicKeyMultibase` are read
|
|
18
|
+
* @param [options.keyAgreementKey.id] {string}
|
|
19
|
+
* @param [options.keyAgreementKey.type] {string}
|
|
20
|
+
* @param [options.keyAgreementKey.publicKeyMultibase] {string}
|
|
21
|
+
* @returns {IKeyResolver}
|
|
22
|
+
*/
|
|
23
|
+
export declare function singleKeyResolver({ keyAgreementKey }: {
|
|
24
|
+
keyAgreementKey: {
|
|
25
|
+
id?: string;
|
|
26
|
+
type?: string;
|
|
27
|
+
publicKeyMultibase?: string;
|
|
28
|
+
};
|
|
29
|
+
}): IKeyResolver;
|
|
30
|
+
//# sourceMappingURL=keyResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyResolver.d.ts","sourceRoot":"","sources":["../../src/identity/keyResolver.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,eAAe,EAChB,EAAE;IACD,eAAe,EAAE;QACf,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAC5B,CAAA;CACF,GAAG,YAAY,CAWf"}
|