@interop/was-client 0.30.0 → 0.32.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 +25 -0
- package/dist/codec.d.ts +1 -1
- package/dist/edv/descriptorStore.d.ts +13 -9
- package/dist/edv/descriptorStore.d.ts.map +1 -1
- package/dist/edv/descriptorStore.js +5 -3
- package/dist/edv/descriptorStore.js.map +1 -1
- package/dist/edv/epochKeys.d.ts.map +1 -1
- package/dist/edv/epochKeys.js +10 -46
- package/dist/edv/epochKeys.js.map +1 -1
- package/dist/edv/index.d.ts +0 -2
- package/dist/edv/index.d.ts.map +1 -1
- package/dist/edv/index.js +0 -1
- package/dist/edv/index.js.map +1 -1
- package/dist/edv/recipients.d.ts +5 -24
- package/dist/edv/recipients.d.ts.map +1 -1
- package/dist/edv/recipients.js +18 -90
- package/dist/edv/recipients.js.map +1 -1
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +10 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/conditional.d.ts +3 -3
- package/dist/internal/conditional.d.ts.map +1 -1
- package/dist/internal/conditional.js +4 -4
- package/dist/internal/conditional.js.map +1 -1
- package/dist/log/index.d.ts +24 -0
- package/dist/log/index.d.ts.map +1 -0
- package/dist/log/index.js +22 -0
- package/dist/log/index.js.map +1 -0
- package/dist/log/jsonl.d.ts +49 -0
- package/dist/log/jsonl.d.ts.map +1 -0
- package/dist/log/jsonl.js +60 -0
- package/dist/log/jsonl.js.map +1 -0
- package/dist/log/logStore.d.ts +95 -0
- package/dist/log/logStore.d.ts.map +1 -0
- package/dist/log/logStore.js +123 -0
- package/dist/log/logStore.js.map +1 -0
- 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 +2 -2
- package/dist/sync/port.d.ts.map +1 -1
- package/dist/sync/port.js +2 -2
- package/dist/sync/port.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -2
- package/dist/edv/epochMac.d.ts +0 -56
- package/dist/edv/epochMac.d.ts.map +0 -1
- package/dist/edv/epochMac.js +0 -148
- package/dist/edv/epochMac.js.map +0 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
- [Registering a Bring-Your-Own-Storage backend](#registering-a-bring-your-own-storage-backend)
|
|
26
26
|
- [Encrypted collections (EDV-over-WAS): pass-through encryption via the WAS client (recommended)](#encrypted-collections-edv-over-was-pass-through-encryption-via-the-was-client-recommended)
|
|
27
27
|
- [Cross-replica sync](#cross-replica-sync)
|
|
28
|
+
- [Resource logs (co-managed key resources)](#resource-logs-co-managed-key-resources)
|
|
28
29
|
- [Export and import](#export-and-import)
|
|
29
30
|
- [The manual-request escape hatch](#the-manual-request-escape-hatch)
|
|
30
31
|
- [Errors and the 404/null caveat](#errors-and-the-404null-caveat)
|
|
@@ -745,6 +746,30 @@ graph. To sync an encrypted collection, keep the same port and swap in
|
|
|
745
746
|
`createEdvDocCipher` -- the change feed and the port ship the envelope bytes
|
|
746
747
|
unchanged either way, so the server never sees plaintext.
|
|
747
748
|
|
|
749
|
+
### Resource logs (co-managed key resources)
|
|
750
|
+
|
|
751
|
+
The opt-in `@interop/was-client/log` subpath is the transport layer for resource
|
|
752
|
+
logs -- the hash-linked, JSON Lines log format (the App Connect spec's Resource
|
|
753
|
+
Log Profile) governing key resources co-managed between a wallet's clients and
|
|
754
|
+
the storage server, such as encryption descriptors and key rosters. It is
|
|
755
|
+
transport only: chain verification (SCID, entry hashes, proofs, authorization,
|
|
756
|
+
the chain-head pin) lives in the consuming verifier.
|
|
757
|
+
|
|
758
|
+
- **`parseResourceLog` / `serializeResourceLog`** -- strict JSON Lines: a
|
|
759
|
+
non-object line is a parse failure, not a skip.
|
|
760
|
+
- **`resourceLogStore({ resource })`** -- the log-store seam over a WAS Resource
|
|
761
|
+
(stored as `text/jsonl`): read-with-etag of the full log, compare-and-swap
|
|
762
|
+
append conditioned on that etag, and the guarded create of a genesis entry.
|
|
763
|
+
Appends carry the prior lines' bytes forward verbatim. Both writes ride the
|
|
764
|
+
backend's `conditional-writes` feature, which the profile requires.
|
|
765
|
+
- **`confirmAppend({ store, entry })`** -- the profile's "acknowledgement is a
|
|
766
|
+
promise" rule: read the log back after an acked append and check the entry is
|
|
767
|
+
actually in the served history (else `LogNotConfirmedError`) before treating
|
|
768
|
+
the append as durable.
|
|
769
|
+
|
|
770
|
+
The subpath is crypto-free and re-exports the wire types (`ResourceLogEntry` et
|
|
771
|
+
al.) from `@interop/storage-core`.
|
|
772
|
+
|
|
748
773
|
### Export and import
|
|
749
774
|
|
|
750
775
|
```ts
|
package/dist/codec.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ export interface ResponseLike {
|
|
|
82
82
|
* `envelope` parses `body` itself.
|
|
83
83
|
* - `epoch` -- the key-epoch id the codec encrypted this write under, on a
|
|
84
84
|
* multi-recipient encrypted collection. The write path emits it as the
|
|
85
|
-
* `
|
|
85
|
+
* `Key-Epoch` request header, so the server stamps
|
|
86
86
|
* {@link ResourceMetadata.epoch}. Absent for a plaintext or single-key
|
|
87
87
|
* encrypted write (the header is then not sent, which clears any prior stamp).
|
|
88
88
|
*/
|
|
@@ -18,12 +18,14 @@
|
|
|
18
18
|
* `version`) on this path.
|
|
19
19
|
* - {@link resourceDescriptorStore} -- a descriptor stored verbatim as a JSON Resource.
|
|
20
20
|
* The server treats the resource as opaque content and enforces NO descriptor
|
|
21
|
-
* invariants there;
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
21
|
+
* invariants there; rollback/tamper detection rests on client-side epoch
|
|
22
|
+
* pinning plus whatever governance the hosting profile adds -- for a
|
|
23
|
+
* log-governed descriptor (the Resource Log Profile), the verified entry
|
|
24
|
+
* proofs and the chain-head pin. Both the compare-and-swap and the
|
|
25
|
+
* create-if-absent guard ride the backend's `conditional-writes` feature.
|
|
26
|
+
* The hosting collection must be plaintext: on an encrypted collection the
|
|
27
|
+
* EDV codec computes the write preconditions itself and the store's
|
|
28
|
+
* `ifMatch` would not be honored.
|
|
27
29
|
*/
|
|
28
30
|
import type { Collection } from '../Collection.js';
|
|
29
31
|
import type { Resource } from '../Resource.js';
|
|
@@ -103,9 +105,11 @@ export declare function collectionDescriptorStore({ collection }: {
|
|
|
103
105
|
* than an `edv`-scheme descriptor object.
|
|
104
106
|
*
|
|
105
107
|
* The server enforces no descriptor invariants on a resource (unlike a
|
|
106
|
-
* Collection Description): rollback/tamper detection rests on
|
|
107
|
-
*
|
|
108
|
-
*
|
|
108
|
+
* Collection Description): rollback/tamper detection rests on client-side
|
|
109
|
+
* epoch pinning plus whatever governance the hosting profile adds (for a
|
|
110
|
+
* log-governed descriptor, the Resource Log Profile's verified entry proofs
|
|
111
|
+
* and chain-head pin), and the CAS/create guards ride the backend's
|
|
112
|
+
* `conditional-writes` feature. Host the resource in a plaintext
|
|
109
113
|
* collection -- on an encrypted collection the EDV codec computes the write
|
|
110
114
|
* preconditions itself, so this store's `ifMatch` would not be honored.
|
|
111
115
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptorStore.d.ts","sourceRoot":"","sources":["../../src/edv/descriptorStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"descriptorStore.d.ts","sourceRoot":"","sources":["../../src/edv/descriptorStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG9C,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,aAAa,CAAA;AAEpB;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;OASG;IACH,IAAI,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,oBAAoB,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;IAE3E;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,UAAU,EAAE,oBAAoB,EAChC,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5B,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhB;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,yBAAyB,CAoC5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAA;CACnB,GAAG,yBAAyB,CAgC5B"}
|
|
@@ -54,9 +54,11 @@ export function collectionDescriptorStore({ collection }) {
|
|
|
54
54
|
* than an `edv`-scheme descriptor object.
|
|
55
55
|
*
|
|
56
56
|
* The server enforces no descriptor invariants on a resource (unlike a
|
|
57
|
-
* Collection Description): rollback/tamper detection rests on
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
* Collection Description): rollback/tamper detection rests on client-side
|
|
58
|
+
* epoch pinning plus whatever governance the hosting profile adds (for a
|
|
59
|
+
* log-governed descriptor, the Resource Log Profile's verified entry proofs
|
|
60
|
+
* and chain-head pin), and the CAS/create guards ride the backend's
|
|
61
|
+
* `conditional-writes` feature. Host the resource in a plaintext
|
|
60
62
|
* collection -- on an encrypted collection the EDV codec computes the write
|
|
61
63
|
* preconditions itself, so this store's `ifMatch` would not be honored.
|
|
62
64
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptorStore.js","sourceRoot":"","sources":["../../src/edv/descriptorStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"descriptorStore.js","sourceRoot":"","sources":["../../src/edv/descriptorStore.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AA0D9C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CAAC,EACxC,UAAU,EAGX;IACC,6EAA6E;IAC7E,4EAA4E;IAC5E,6EAA6E;IAC7E,yEAAyE;IACzE,IAAI,SAA4C,CAAA;IAChD,OAAO;QACL,KAAK,CAAC,IAAI;YACR,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,gBAAgB,EAAE,CAAA;YACnD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,MAAM,0BAA0B,CAAC;oBAC/B,SAAS,EAAE,mBAAmB;oBAC9B,MAAM,EAAE,4DAA4D;iBACrE,CAAC,CAAA;YACJ,CAAC;YACD,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAA;YACjD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;gBAC/C,MAAM,IAAI,eAAe,CACvB,4DAA4D;oBAC1D,kCAAkC,CACrC,CAAA;YACH,CAAC;YACD,SAAS,GAAG,OAAO,CAAC,WAAW,CAAA;YAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAA;QAC3C,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE;YACnC,MAAM,UAAU,CAAC,kBAAkB,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GASG;AACH,SAAS,gBAAgB,CAAC,UAAgC;IACxD,OAAO,UAAmC,CAAA;AAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochKeys.d.ts","sourceRoot":"","sources":["../../src/edv/epochKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"epochKeys.d.ts","sourceRoot":"","sources":["../../src/edv/epochKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,aAAa,CAAA;AAOpB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAA;IAC1B;;;;OAIG;IACH,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAC7B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,UAAU,EACV,eAAe,EAChB,EAAE;IACD,UAAU,EAAE,oBAAoB,CAAA;IAChC,eAAe,EAAE,gBAAgB,CAAA;CAClC,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CA6DpC"}
|
package/dist/edv/epochKeys.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KeyUnwrapError } from '../errors.js';
|
|
2
2
|
import { epochKeyIdFor, reconstructEpochKeyPair, unwrapEpochSecret } from './epochCrypto.js';
|
|
3
|
-
import { verifyEpochsMac } from './epochMac.js';
|
|
4
3
|
/**
|
|
5
4
|
* Resolves the reader's epoch keys from a descriptor. Returns `null` when the
|
|
6
5
|
* descriptor declares no epochs (the epoch codec refuses such a descriptor
|
|
@@ -42,49 +41,17 @@ export async function resolveEpochKeys({ encryption, keyAgreementKey }) {
|
|
|
42
41
|
const writeEpochEntry = namedEpochs.find(epoch => epoch.id === encryption.currentEpoch) ??
|
|
43
42
|
namedEpochs.at(-1);
|
|
44
43
|
// The write epoch is unwrapped eagerly: `writeKey` must be a full key pair the
|
|
45
|
-
// EDV cipher can name recipients with and encrypt under right away.
|
|
46
|
-
|
|
47
|
-
const writeUnwrapped = await unwrapEpochKey({
|
|
44
|
+
// EDV cipher can name recipients with and encrypt under right away.
|
|
45
|
+
const writeKey = await unwrapEpochKey({
|
|
48
46
|
epoch: writeEpochEntry,
|
|
49
47
|
keyAgreementKey
|
|
50
48
|
});
|
|
51
|
-
if (!
|
|
49
|
+
if (!writeKey) {
|
|
52
50
|
throw new KeyUnwrapError(`This reader's recipient entry for the write epoch ` +
|
|
53
51
|
`"${writeEpochEntry.id}" did not unwrap (a corrupt entry). Re-add ` +
|
|
54
52
|
'this reader with addRecipient, or supply the correct key-agreement ' +
|
|
55
53
|
'key.');
|
|
56
54
|
}
|
|
57
|
-
const writeKey = writeUnwrapped.key;
|
|
58
|
-
// Authenticate the epoch configuration when this reader holds the
|
|
59
|
-
// descriptor's `currentEpoch` (its write epoch IS `currentEpoch`). A reader
|
|
60
|
-
// whose write epoch is an older held epoch cannot key the MAC (its secret is
|
|
61
|
-
// not the current epoch's), so it skips verification -- its writes are
|
|
62
|
-
// rejected server-side via its revoked zcap anyway. An absent MAC is refused:
|
|
63
|
-
// every descriptor carries `epochsMac` from creation (epoch-from-birth left
|
|
64
|
-
// no MAC-less era), so a descriptor without one is a server-side strip.
|
|
65
|
-
if (writeEpochEntry.id === encryption.currentEpoch) {
|
|
66
|
-
if (encryption.epochsMac === undefined) {
|
|
67
|
-
throw new IntegrityError('The epoch configuration failed to authenticate: the descriptor ' +
|
|
68
|
-
'carries no `epochsMac`. Every encrypted collection descriptor is ' +
|
|
69
|
-
'MAC-authenticated from creation, so an absent MAC is a ' +
|
|
70
|
-
'server-side strip of the integrity binding.');
|
|
71
|
-
}
|
|
72
|
-
const { v, alg } = encryption.epochsMac;
|
|
73
|
-
if (v !== 1 || alg !== 'HS256') {
|
|
74
|
-
throw new IntegrityError('The epoch configuration failed to authenticate: its MAC declares an ' +
|
|
75
|
-
`unsupported construction (v=${v}, alg="${alg}"). This is a ` +
|
|
76
|
-
'server-side rollback or tamper.');
|
|
77
|
-
}
|
|
78
|
-
const authentic = await verifyEpochsMac({
|
|
79
|
-
descriptor: encryption,
|
|
80
|
-
epochSecret: writeUnwrapped.secret
|
|
81
|
-
});
|
|
82
|
-
if (!authentic) {
|
|
83
|
-
throw new IntegrityError('The epoch configuration failed to authenticate; a server-side ' +
|
|
84
|
-
'rollback or tamper of the encryption descriptor was detected (the ' +
|
|
85
|
-
'MAC over its epoch configuration does not verify).');
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
55
|
// Read keys: the eagerly-unwrapped write key, plus a LAZY key per other named
|
|
89
56
|
// epoch. Each lazy key knows its `id` up front (derived from the epoch id, so
|
|
90
57
|
// the codec's kid-match filter needs no secret) and unwraps + reconstructs its
|
|
@@ -103,15 +70,12 @@ export async function resolveEpochKeys({ encryption, keyAgreementKey }) {
|
|
|
103
70
|
/**
|
|
104
71
|
* Unwraps and reconstructs a single epoch's key pair for this reader, or returns
|
|
105
72
|
* `null` when the reader is not a recipient of the epoch or its entry does not
|
|
106
|
-
* unwrap (a corrupt entry -- never treat `null` as a key).
|
|
107
|
-
* 32-byte epoch secret alongside the reconstructed key pair, so a caller that
|
|
108
|
-
* must authenticate the epoch configuration (the `epochsMac`) can key the MAC
|
|
109
|
-
* without re-unwrapping.
|
|
73
|
+
* unwrap (a corrupt entry -- never treat `null` as a key).
|
|
110
74
|
*
|
|
111
75
|
* @param options {object}
|
|
112
76
|
* @param options.epoch {CollectionEncryptionEpoch} the epoch to unwrap
|
|
113
77
|
* @param options.keyAgreementKey {IKeyAgreementKey} the reader's own KAK
|
|
114
|
-
* @returns {Promise<
|
|
78
|
+
* @returns {Promise<IKeyAgreementKey | null>}
|
|
115
79
|
*/
|
|
116
80
|
async function unwrapEpochKey({ epoch, keyAgreementKey }) {
|
|
117
81
|
const entry = epoch.recipients.find(recipient => recipient.header.kid === keyAgreementKey.id);
|
|
@@ -122,7 +86,7 @@ async function unwrapEpochKey({ epoch, keyAgreementKey }) {
|
|
|
122
86
|
if (!secret) {
|
|
123
87
|
return null;
|
|
124
88
|
}
|
|
125
|
-
return
|
|
89
|
+
return reconstructEpochKeyPair({ epochId: epoch.id, secret });
|
|
126
90
|
}
|
|
127
91
|
/**
|
|
128
92
|
* Builds a lazily-unwrapping read key for a named epoch: an `IKeyAgreementKey`
|
|
@@ -142,8 +106,8 @@ function lazyEpochKey({ epoch, keyAgreementKey }) {
|
|
|
142
106
|
let pending;
|
|
143
107
|
const resolve = () => {
|
|
144
108
|
if (pending === undefined) {
|
|
145
|
-
const promise = unwrapEpochKey({ epoch, keyAgreementKey }).then(
|
|
146
|
-
if (!
|
|
109
|
+
const promise = unwrapEpochKey({ epoch, keyAgreementKey }).then(key => {
|
|
110
|
+
if (!key) {
|
|
147
111
|
// The reader was named in this epoch (else no lazy key was built)
|
|
148
112
|
// but its entry did not unwrap: a corrupt entry. The codec's
|
|
149
113
|
// `_decrypt` catches this and tries the next candidate before
|
|
@@ -151,7 +115,7 @@ function lazyEpochKey({ epoch, keyAgreementKey }) {
|
|
|
151
115
|
throw new KeyUnwrapError(`This reader's recipient entry for epoch "${epoch.id}" did not ` +
|
|
152
116
|
'unwrap (a corrupt entry).');
|
|
153
117
|
}
|
|
154
|
-
return
|
|
118
|
+
return key;
|
|
155
119
|
});
|
|
156
120
|
// Cache only a successful unwrap: drop a rejected promise so the next
|
|
157
121
|
// read re-attempts (the failure may have been transient), rather than
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochKeys.js","sourceRoot":"","sources":["../../src/edv/epochKeys.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"epochKeys.js","sourceRoot":"","sources":["../../src/edv/epochKeys.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAK7C,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AAuBzB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,UAAU,EACV,eAAe,EAIhB;IACC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;IAChC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;IACD,yEAAyE;IACzE,sEAAsE;IACtE,6EAA6E;IAC7E,8DAA8D;IAC9D,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACxC,KAAK,CAAC,UAAU,CAAC,IAAI,CACnB,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,eAAe,CAAC,EAAE,CACzD,CACF,CAAA;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,cAAc,CACtB,oEAAoE;YAClE,mEAAmE;YACnE,qEAAqE;YACrE,uCAAuC,CAC1C,CAAA;IACH,CAAC;IACD,8EAA8E;IAC9E,8EAA8E;IAC9E,8EAA8E;IAC9E,+EAA+E;IAC/E,2EAA2E;IAC3E,wEAAwE;IACxE,0EAA0E;IAC1E,wEAAwE;IACxE,MAAM,eAAe,GACnB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,UAAU,CAAC,YAAY,CAAC;QAC/D,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/dist/edv/index.d.ts
CHANGED
|
@@ -43,8 +43,6 @@ export { isEd25519DidKey, x25519RecipientFromDidKey } from './didKeyRecipient.js
|
|
|
43
43
|
export { collectionDescriptorStore, resourceDescriptorStore } from './descriptorStore.js';
|
|
44
44
|
export type { EncryptionDescriptorStore } from './descriptorStore.js';
|
|
45
45
|
export { mintEpoch, epochKeyIdFor, unwrapEpochSecret, wrapEpochSecret } from './epochCrypto.js';
|
|
46
|
-
export { computeEpochsMac, epochsSigPayload, verifyEpochsMac } from './epochMac.js';
|
|
47
|
-
export type { EpochsSigner } from './epochMac.js';
|
|
48
46
|
export { resolveEpochKeys } from './epochKeys.js';
|
|
49
47
|
export type { ResolvedEpochKeys } from './epochKeys.js';
|
|
50
48
|
export { createEdvDocCipher, ownerRecipient, UnknownEpochError, isEncryptedEnvelope } from './docCipher.js';
|
package/dist/edv/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EACL,eAAe,EACf,yBAAyB,EAC1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EACL,eAAe,EACf,yBAAyB,EAC1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/edv/index.js
CHANGED
|
@@ -40,7 +40,6 @@ export { ensureFirstEpoch, initRecipients, addRecipient, removeRecipient, replac
|
|
|
40
40
|
export { isEd25519DidKey, x25519RecipientFromDidKey } from './didKeyRecipient.js';
|
|
41
41
|
export { collectionDescriptorStore, resourceDescriptorStore } from './descriptorStore.js';
|
|
42
42
|
export { mintEpoch, epochKeyIdFor, unwrapEpochSecret, wrapEpochSecret } from './epochCrypto.js';
|
|
43
|
-
export { computeEpochsMac, epochsSigPayload, verifyEpochsMac } from './epochMac.js';
|
|
44
43
|
export { resolveEpochKeys } from './epochKeys.js';
|
|
45
44
|
export { createEdvDocCipher, ownerRecipient, UnknownEpochError, isEncryptedEnvelope } from './docCipher.js';
|
|
46
45
|
//# sourceMappingURL=index.js.map
|
package/dist/edv/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,eAAe,EACf,yBAAyB,EAC1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,eAAe,EACf,yBAAyB,EAC1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA"}
|
package/dist/edv/recipients.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ import type { Collection } from '../Collection.js';
|
|
|
36
36
|
import type { Space } from '../Space.js';
|
|
37
37
|
import type { EncryptionDescriptorStore } from './descriptorStore.js';
|
|
38
38
|
import type { CollectionEncryption, IDelegatedZcap } from '../types.js';
|
|
39
|
-
import type { EpochsSigner } from './epochMac.js';
|
|
40
39
|
import type { RecipientPublicKey } from './epochCrypto.js';
|
|
41
40
|
export type { RecipientPublicKey } from './epochCrypto.js';
|
|
42
41
|
/**
|
|
@@ -71,18 +70,14 @@ export type { RecipientPublicKey } from './epochCrypto.js';
|
|
|
71
70
|
* @param [options.store] {EncryptionDescriptorStore} an explicit descriptor store
|
|
72
71
|
* @param options.recipients {RecipientPublicKey[]} the initial readers' public
|
|
73
72
|
* key-agreement keys (each `id` is the reader's `kid`)
|
|
74
|
-
* @param [options.signEpochs] {EpochsSigner} signs the epoch configuration
|
|
75
|
-
* being written, stamping the descriptor's `epochsSig` beside its
|
|
76
|
-
* `epochsMac`
|
|
77
73
|
* @returns {Promise<{ descriptor: CollectionEncryption, installed: boolean }>}
|
|
78
74
|
* the collection's epoch-bearing descriptor, and whether this call installed
|
|
79
75
|
* its epoch[0] (`false` means an existing roster was adopted)
|
|
80
76
|
*/
|
|
81
|
-
export declare function ensureFirstEpoch({ collection, store, recipients
|
|
77
|
+
export declare function ensureFirstEpoch({ collection, store, recipients }: {
|
|
82
78
|
collection?: Collection;
|
|
83
79
|
store?: EncryptionDescriptorStore;
|
|
84
80
|
recipients: RecipientPublicKey[];
|
|
85
|
-
signEpochs?: EpochsSigner;
|
|
86
81
|
}): Promise<{
|
|
87
82
|
descriptor: CollectionEncryption;
|
|
88
83
|
installed: boolean;
|
|
@@ -113,12 +108,9 @@ export declare function ensureFirstEpoch({ collection, store, recipients, signEp
|
|
|
113
108
|
* whose epoch key already exists (e.g. a per-user key being enrolled into
|
|
114
109
|
* its wrap-set roster). The `epochId` must be the key's did:key and `secret`
|
|
115
110
|
* its raw 32-byte private key, exactly what {@link mintEpoch} returns.
|
|
116
|
-
* @param [options.signEpochs] {EpochsSigner} signs the epoch configuration
|
|
117
|
-
* being written, stamping the descriptor's `epochsSig` beside its
|
|
118
|
-
* `epochsMac`
|
|
119
111
|
* @returns {Promise<CollectionEncryption>} the new descriptor
|
|
120
112
|
*/
|
|
121
|
-
export declare function initRecipients({ collection, store, recipients, epoch: premintedEpoch
|
|
113
|
+
export declare function initRecipients({ collection, store, recipients, epoch: premintedEpoch }: {
|
|
122
114
|
collection?: Collection;
|
|
123
115
|
store?: EncryptionDescriptorStore;
|
|
124
116
|
recipients: RecipientPublicKey[];
|
|
@@ -126,7 +118,6 @@ export declare function initRecipients({ collection, store, recipients, epoch: p
|
|
|
126
118
|
epochId: string;
|
|
127
119
|
secret: Uint8Array;
|
|
128
120
|
};
|
|
129
|
-
signEpochs?: EpochsSigner;
|
|
130
121
|
}): Promise<CollectionEncryption>;
|
|
131
122
|
/**
|
|
132
123
|
* Adds a reader to a multi-recipient encrypted Collection. Escrow semantics: the
|
|
@@ -209,12 +200,9 @@ export declare function addRecipient({ collection, store, recipient, owner }: {
|
|
|
209
200
|
* self-describing `did:key`. May resolve `null` to signal drop-this-kid:
|
|
210
201
|
* the rotation then excludes that entry from the fresh epoch instead of
|
|
211
202
|
* throwing (subject to the no-recipients-remaining guard).
|
|
212
|
-
* @param [options.signEpochs] {EpochsSigner} signs the rotated epoch
|
|
213
|
-
* configuration, stamping the descriptor's `epochsSig` beside its
|
|
214
|
-
* `epochsMac`
|
|
215
203
|
* @returns {Promise<CollectionEncryption>} the new descriptor
|
|
216
204
|
*/
|
|
217
|
-
export declare function removeRecipient({ collection, store, space, recipientId, revoke, pull, resolveRecipientKey
|
|
205
|
+
export declare function removeRecipient({ collection, store, space, recipientId, revoke, pull, resolveRecipientKey }: {
|
|
218
206
|
collection?: Collection;
|
|
219
207
|
store?: EncryptionDescriptorStore;
|
|
220
208
|
space?: Space;
|
|
@@ -222,7 +210,6 @@ export declare function removeRecipient({ collection, store, space, recipientId,
|
|
|
222
210
|
revoke?: IDelegatedZcap | IDelegatedZcap[];
|
|
223
211
|
pull?: () => Promise<void>;
|
|
224
212
|
resolveRecipientKey?: (kid: string) => Promise<RecipientPublicKey | null>;
|
|
225
|
-
signEpochs?: EpochsSigner;
|
|
226
213
|
}): Promise<CollectionEncryption>;
|
|
227
214
|
/**
|
|
228
215
|
* Replaces one reader (or several) with another in ONE descriptor write -- the
|
|
@@ -239,9 +226,7 @@ export declare function removeRecipient({ collection, store, space, recipientId,
|
|
|
239
226
|
* recipient remains in the current epoch, nothing is written at all -- a naive
|
|
240
227
|
* re-run after a crash appends zero redundant epochs. An escrow-only state
|
|
241
228
|
* (the incoming recipient missing from some epoch but no retiring recipient
|
|
242
|
-
* current) writes the escrow wraps without minting an epoch
|
|
243
|
-
* is untouched then, since it binds the epoch configuration, not the
|
|
244
|
-
* recipient wraps.
|
|
229
|
+
* current) writes the escrow wraps without minting an epoch.
|
|
245
230
|
*
|
|
246
231
|
* The pull-axis contract is {@link removeRecipient}'s verbatim: the default
|
|
247
232
|
* zcap revocation (`space` + `revoke`) or a caller-supplied `pull` action,
|
|
@@ -273,12 +258,9 @@ export declare function removeRecipient({ collection, store, space, recipientId,
|
|
|
273
258
|
* recipient's kid for the fresh epoch, `null` to drop it -- the
|
|
274
259
|
* {@link removeRecipient} contract (the incoming recipient never routes
|
|
275
260
|
* through it)
|
|
276
|
-
* @param [options.signEpochs] {EpochsSigner} signs the rotated epoch
|
|
277
|
-
* configuration, stamping the descriptor's `epochsSig` beside its
|
|
278
|
-
* `epochsMac` (an escrow-only write leaves both untouched)
|
|
279
261
|
* @returns {Promise<CollectionEncryption>} the new descriptor
|
|
280
262
|
*/
|
|
281
|
-
export declare function replaceRecipient({ collection, store, space, retire, recipient, owner, revoke, pull, resolveRecipientKey
|
|
263
|
+
export declare function replaceRecipient({ collection, store, space, retire, recipient, owner, revoke, pull, resolveRecipientKey }: {
|
|
282
264
|
collection?: Collection;
|
|
283
265
|
store?: EncryptionDescriptorStore;
|
|
284
266
|
space?: Space;
|
|
@@ -290,6 +272,5 @@ export declare function replaceRecipient({ collection, store, space, retire, rec
|
|
|
290
272
|
revoke?: IDelegatedZcap | IDelegatedZcap[];
|
|
291
273
|
pull?: () => Promise<void>;
|
|
292
274
|
resolveRecipientKey?: (kid: string) => Promise<RecipientPublicKey | null>;
|
|
293
|
-
signEpochs?: EpochsSigner;
|
|
294
275
|
}): Promise<CollectionEncryption>;
|
|
295
276
|
//# sourceMappingURL=recipients.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipients.d.ts","sourceRoot":"","sources":["../../src/edv/recipients.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,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