@interop/was-client 0.92.0 → 0.93.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 +176 -13
- package/dist/Collection.d.ts +43 -6
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +96 -21
- package/dist/Collection.js.map +1 -1
- package/dist/Resource.d.ts +35 -2
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +49 -5
- package/dist/Resource.js.map +1 -1
- package/dist/Space.d.ts +85 -1
- package/dist/Space.d.ts.map +1 -1
- package/dist/Space.js +160 -1
- package/dist/Space.js.map +1 -1
- package/dist/codec.d.ts +26 -0
- package/dist/codec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.d.ts +20 -1
- package/dist/edv/EdvCodec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.js +161 -85
- package/dist/edv/EdvCodec.js.map +1 -1
- package/dist/edv/WasTransport.d.ts.map +1 -1
- package/dist/edv/WasTransport.js +10 -7
- package/dist/edv/WasTransport.js.map +1 -1
- package/dist/errors.d.ts +13 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +98 -49
- package/dist/errors.js.map +1 -1
- package/dist/identity/agents.d.ts +8 -0
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +13 -1
- package/dist/identity/agents.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/blob.d.ts +16 -1
- package/dist/internal/blob.d.ts.map +1 -1
- package/dist/internal/blob.js +34 -1
- package/dist/internal/blob.js.map +1 -1
- package/dist/internal/codec.d.ts +3 -2
- package/dist/internal/codec.d.ts.map +1 -1
- package/dist/internal/codec.js +26 -3
- package/dist/internal/codec.js.map +1 -1
- package/dist/internal/content.d.ts +65 -10
- package/dist/internal/content.d.ts.map +1 -1
- package/dist/internal/content.js +88 -11
- package/dist/internal/content.js.map +1 -1
- package/dist/internal/describe.d.ts.map +1 -1
- package/dist/internal/describe.js +6 -1
- package/dist/internal/describe.js.map +1 -1
- package/dist/internal/paths.d.ts +17 -11
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +23 -11
- package/dist/internal/paths.js.map +1 -1
- package/dist/sync/port.d.ts.map +1 -1
- package/dist/sync/port.js +6 -10
- package/dist/sync/port.js.map +1 -1
- package/dist/sync/types.d.ts +5 -8
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/types.d.ts +12 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -3
package/dist/Space.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Space.js","sourceRoot":"","sources":["../src/Space.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,KAAK,EACN,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,EACjB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,UAAU,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I,CAAC,WAAW;SAC7B,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/dist/codec.d.ts
CHANGED
|
@@ -285,6 +285,14 @@ export type MetaReadSlot = {
|
|
|
285
285
|
* Implementations must be stateless with respect to a given call (a resolved
|
|
286
286
|
* codec is reused across every read/write on the handle).
|
|
287
287
|
*/
|
|
288
|
+
/**
|
|
289
|
+
* What a streaming read resolves: the plaintext bytes as a stream, with the
|
|
290
|
+
* plaintext resource type when the codec knows it.
|
|
291
|
+
*/
|
|
292
|
+
export interface DecodedStream {
|
|
293
|
+
stream: ReadableStream<Uint8Array>;
|
|
294
|
+
contentType?: string;
|
|
295
|
+
}
|
|
288
296
|
export interface ResourceCodec {
|
|
289
297
|
/**
|
|
290
298
|
* The codec's search capability, when it indexes what it stores (the EDV
|
|
@@ -355,6 +363,24 @@ export interface ResourceCodec {
|
|
|
355
363
|
* @returns {Promise<Json | Blob>}
|
|
356
364
|
*/
|
|
357
365
|
decode(response: ResponseLike, expectedId?: string, context?: CodecRequestContext): Promise<Json | Blob>;
|
|
366
|
+
/**
|
|
367
|
+
* The streaming counterpart of {@link decode}, for a caller that cannot
|
|
368
|
+
* buffer a large resource (`Resource.getStream()`). Takes the same inputs
|
|
369
|
+
* and runs the same checks, but resolves the plaintext bytes as a stream
|
|
370
|
+
* instead of a `Json | Blob` value. `contentType` is the plaintext resource
|
|
371
|
+
* type (an encrypting codec's sealed type, not the envelope type), absent
|
|
372
|
+
* when the codec does not know it.
|
|
373
|
+
*
|
|
374
|
+
* Optional, so a third-party codec need not implement it. When it is
|
|
375
|
+
* absent, the handle falls back to {@link decode} and converts the decoded
|
|
376
|
+
* value to a stream in memory.
|
|
377
|
+
*
|
|
378
|
+
* @param response {ResponseLike}
|
|
379
|
+
* @param [expectedId] {string} as for {@link decode}
|
|
380
|
+
* @param [context] {CodecRequestContext} as for {@link decode}
|
|
381
|
+
* @returns {Promise<DecodedStream>}
|
|
382
|
+
*/
|
|
383
|
+
decodeStream?(response: ResponseLike, expectedId?: string, context?: CodecRequestContext): Promise<DecodedStream>;
|
|
358
384
|
/**
|
|
359
385
|
* Transforms a caller's user-writable metadata (`custom`) into the value to
|
|
360
386
|
* store under `custom` on a `PUT .../meta` write. The identity codec returns
|
package/dist/codec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,KAAK,EACV,oBAAoB,EACpB,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;IACxB,OAAO,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AA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KeyAgreementKey, IKeyResolver } from '@interop/data-integrity-core';
|
|
3
|
-
import type { CodecIndexing, CodecRequestContext, CodecWrite, MetaReadSlot, MetaWriteSlot, ResourceCodec, ResponseLike } from '../codec.js';
|
|
3
|
+
import type { CodecIndexing, CodecRequestContext, CodecWrite, DecodedStream, MetaReadSlot, MetaWriteSlot, ResourceCodec, ResponseLike } from '../codec.js';
|
|
4
4
|
import type { WritePrecondition } from '../internal/conditional.js';
|
|
5
5
|
import type { WasTransport } from './WasTransport.js';
|
|
6
6
|
import type { BlindingKey } from './hmacKey.js';
|
|
@@ -152,6 +152,25 @@ export declare class EdvCodec implements ResourceCodec {
|
|
|
152
152
|
* @returns {Promise<Json | Blob>}
|
|
153
153
|
*/
|
|
154
154
|
decode(response: ResponseLike, expectedId?: string, context?: CodecRequestContext, chunkSource?: ChunkSource): Promise<Json | Blob>;
|
|
155
|
+
/**
|
|
156
|
+
* @inheritdoc
|
|
157
|
+
*
|
|
158
|
+
* Opens the envelope exactly as {@link decode} does, with the same checks.
|
|
159
|
+
* A chunked document's decrypt stream is handed back unbuffered, so its
|
|
160
|
+
* chunks are fetched and decrypted as the caller reads; a chunk that fails
|
|
161
|
+
* to fetch or verify then errors the stream rather than this call. An
|
|
162
|
+
* inline document is decoded as {@link decode} decodes it and presented as
|
|
163
|
+
* a one-value stream. `contentType` is the sealed plaintext type.
|
|
164
|
+
*
|
|
165
|
+
* @param response {ResponseLike} the stored envelope
|
|
166
|
+
* @param [expectedId] {string} the resource id the read targeted
|
|
167
|
+
* @param [context] {CodecRequestContext} the signed-request context a
|
|
168
|
+
* chunked document's chunks are fetched through
|
|
169
|
+
* @param [chunkSource] {ChunkSource} serves a chunked document's chunks in
|
|
170
|
+
* place of `context`
|
|
171
|
+
* @returns {Promise<DecodedStream>}
|
|
172
|
+
*/
|
|
173
|
+
decodeStream(response: ResponseLike, expectedId?: string, context?: CodecRequestContext, chunkSource?: ChunkSource): Promise<DecodedStream>;
|
|
155
174
|
/**
|
|
156
175
|
* Whether a stored envelope is a pending stub: the document a chunked write
|
|
157
176
|
* leaves behind when it stops between its first document write and its final
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdvCodec.d.ts","sourceRoot":"","sources":["../../src/edv/EdvCodec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EdvCodec.d.ts","sourceRoot":"","sources":["../../src/edv/EdvCodec.ts"],"names":[],"mappings":"AAuEA,OAAO,EAAE,aAAa,EAA0B,MAAM,0BAA0B,CAAA;AAChF,OAAO,KAAK,EACV,SAAS,EAGT,gBAAgB,EAChB,YAAY,EAEb,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAGV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,aAAa,EAEb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACb,MAAM,aAAa,CAAA;AAmBpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAMrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAS/C,OAAO,KAAK,EACV,oBAAoB,EACpB,IAAI,EACJ,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,aAAa,CAAA;AAOpB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,QAAa,CAAA;AAWhD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE;IAC5C,OAAO,EAAE,mBAAmB,CAAA;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzC,KAAK,YAAY,CAAA;AAElB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB,KAA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37
|
* - **Inline non-JSON as a single JWE.** A `Blob`/`Uint8Array` under the size cap
|
|
38
38
|
* is encrypted as one document -- stored as a legible UTF-8 string for a
|
|
39
39
|
* text-family type (else base64) -- with the plaintext content type and the
|
|
40
|
-
* encoding carried in the document `meta`. A blob over `maxBlobBytes
|
|
41
|
-
* auto-routed by `add()` to
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* `
|
|
45
|
-
* returns the same `Blob` either way
|
|
40
|
+
* encoding carried in the document `meta`. A blob over `maxBlobBytes`, and
|
|
41
|
+
* any `ReadableStream` (whose size is unknown), is auto-routed by `add()` to
|
|
42
|
+
* the chunked-stream path instead: `encode` returns a multi-request plan the
|
|
43
|
+
* write path executes, storing one document plus its chunk resources over a
|
|
44
|
+
* `WasTransport` supplied by the injected `CodecTransportFactory`. Reads
|
|
45
|
+
* reassemble transparently, so `get()` returns the same `Blob` either way,
|
|
46
|
+
* and `decodeStream` hands a chunked document's decrypt stream back
|
|
47
|
+
* unbuffered.
|
|
46
48
|
* - **Enforced sequence (conditional writes).** The codec sets
|
|
47
49
|
* `conditionalWrites`, so the write path pre-reads the current envelope and
|
|
48
50
|
* hands it to `encode`: an update advances `sequence` from its prior value and
|
|
@@ -70,14 +72,14 @@ import { base64, base64urlnopad } from '@scure/base';
|
|
|
70
72
|
import { EdvClientCore, Transport, assertDocId } from '@interop/edv-client/core';
|
|
71
73
|
import { EMPTY_INDEX_SCHEMA, assertQueryAttributes } from '../internal/indexSchema.js';
|
|
72
74
|
import { ConflictError, EncryptionError, IntegrityError, KeyUnwrapError, NotFoundError, NotSupportedError, PreconditionFailedError, QuotaExceededError, UnknownEpochError, ValidationError } from '../errors.js';
|
|
73
|
-
import { blobBytes } from '../internal/blob.js';
|
|
75
|
+
import { blobBytes, bytesToStream } from '../internal/blob.js';
|
|
74
76
|
import { readEtag, writeHeaders } from '../internal/conditional.js';
|
|
75
77
|
import { isEncryptedEnvelope } from '../sync/envelope.js';
|
|
76
78
|
import { epochWriteStandIn, resolveEpochKeys } from './epochKeys.js';
|
|
77
79
|
import { didKeyResolver } from './epochCrypto.js';
|
|
78
80
|
import { currentEpochOf, hasKeyEpochs } from './epochRoster.js';
|
|
79
81
|
import { resolveHmacKey } from './hmacKey.js';
|
|
80
|
-
import { DECODER, isBlob, isTextContentType, readJsonData, resolvePayload } from '../internal/content.js';
|
|
82
|
+
import { DECODER, decodedStream, isBlob, isTextContentType, readJsonData, resolvePayload } from '../internal/content.js';
|
|
81
83
|
import { DEFAULT_CONTENT_TYPE, EDV_SCHEME_VERSION, envelopeBytes } from './constants.js';
|
|
82
84
|
/**
|
|
83
85
|
* Default threshold above which an encrypted binary write is routed to the
|
|
@@ -438,14 +440,21 @@ export class EdvCodec {
|
|
|
438
440
|
const parts = await this.#toDocument(data, contentType, docId);
|
|
439
441
|
if (parts.kind === 'chunked') {
|
|
440
442
|
if (docId === undefined) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
'under the threshold
|
|
443
|
+
// A stream is chunked whatever its size, so only a sized payload can
|
|
444
|
+
// be brought under the threshold.
|
|
445
|
+
const why = parts.size === undefined
|
|
446
|
+
? 'Encrypted stream write has no known size'
|
|
447
|
+
: `Encrypted binary write of ${parts.size} bytes exceeds the ` +
|
|
448
|
+
`single-document threshold of ${this.#maxBlobBytes} bytes`;
|
|
449
|
+
const remedy = parts.size === undefined
|
|
450
|
+
? 'buffer the stream into a Blob under the threshold'
|
|
451
|
+
: 'keep the payload under the threshold';
|
|
452
|
+
throw new ValidationError(`${why}, so it must be stored as a document plus chunk resources. ` +
|
|
453
|
+
"A content-addressed collection (idDerivation: 'content') cannot " +
|
|
454
|
+
'store a document plus chunk resources: the document is written ' +
|
|
455
|
+
'twice (once to reserve it, once to record the chunk count), so ' +
|
|
456
|
+
'no single ciphertext derives its id. Store it in a random-id ' +
|
|
457
|
+
`collection, or ${remedy}.`);
|
|
449
458
|
}
|
|
450
459
|
return this.#chunkedWrite({
|
|
451
460
|
id: docId,
|
|
@@ -571,11 +580,11 @@ export class EdvCodec {
|
|
|
571
580
|
return this.#transportFactory({ context, documentHeaders });
|
|
572
581
|
}
|
|
573
582
|
/**
|
|
574
|
-
* The plan for a binary payload over the single-document threshold
|
|
575
|
-
* document plus its chunk resources, written
|
|
576
|
-
* stream, transport })` over a transport
|
|
577
|
-
* document id is minted before the plan
|
|
578
|
-
* it without waiting for the write.
|
|
583
|
+
* The plan for a binary payload over the single-document threshold, or for
|
|
584
|
+
* a stream of any size: one EDV document plus its chunk resources, written
|
|
585
|
+
* by `EdvClientCore.insert({ doc, stream, transport })` over a transport
|
|
586
|
+
* built from the write context. The document id is minted before the plan
|
|
587
|
+
* is returned, so the caller can report it without waiting for the write.
|
|
579
588
|
*
|
|
580
589
|
* The `was` binding, the recipients and the write epoch are exactly the
|
|
581
590
|
* single-document path's, and `additionalProtectedParams` carries the binding
|
|
@@ -597,7 +606,9 @@ export class EdvCodec {
|
|
|
597
606
|
* undecryptable and listed. The plan therefore compensates: if the document
|
|
598
607
|
* was written and the write then failed, it best-effort deletes the stub
|
|
599
608
|
* before rethrowing. A stub that survives (the process died, or the cleanup
|
|
600
|
-
* failed) is recognized with {@link isPendingStub}.
|
|
609
|
+
* failed) is recognized with {@link isPendingStub}. The EDV core cancels the
|
|
610
|
+
* caller's source stream on such a failure, so the source behind it is
|
|
611
|
+
* released.
|
|
601
612
|
*
|
|
602
613
|
* @param options {object}
|
|
603
614
|
* @param options.id {string} the document id (minted, or the caller's)
|
|
@@ -615,10 +626,10 @@ export class EdvCodec {
|
|
|
615
626
|
// for a write by id over an existing document: only this codec knows
|
|
616
627
|
// why the payload needs several requests, and which low-level API
|
|
617
628
|
// writes one directly.
|
|
618
|
-
guidance: 'This payload is too large for a single encrypted document,
|
|
619
|
-
'stored as a document plus chunk resources. Drive
|
|
620
|
-
'with `EdvClientCore.update({ doc, stream,
|
|
621
|
-
'`WasTransport`.',
|
|
629
|
+
guidance: 'This payload is too large for a single encrypted document, or is a ' +
|
|
630
|
+
'stream, so it is stored as a document plus chunk resources. Drive ' +
|
|
631
|
+
'the write yourself with `EdvClientCore.update({ doc, stream, ' +
|
|
632
|
+
'transport })` over a `WasTransport`.',
|
|
622
633
|
execute: async (context) => {
|
|
623
634
|
// The EDV core owns the write and swallows the responses, so the
|
|
624
635
|
// transport reports the document write it made: whether one landed at
|
|
@@ -788,6 +799,72 @@ export class EdvCodec {
|
|
|
788
799
|
* @returns {Promise<Json | Blob>}
|
|
789
800
|
*/
|
|
790
801
|
async decode(response, expectedId, context, chunkSource) {
|
|
802
|
+
const opened = await this.#openStored({
|
|
803
|
+
response,
|
|
804
|
+
expectedId,
|
|
805
|
+
context,
|
|
806
|
+
chunkSource
|
|
807
|
+
});
|
|
808
|
+
if (opened.kind === 'chunked') {
|
|
809
|
+
// Reassemble: buffer the decrypt stream into the same `Blob` a small
|
|
810
|
+
// binary read returns, typed with the sealed plaintext content type.
|
|
811
|
+
const { stream, contentType } = await this.#chunkedStream(opened.read);
|
|
812
|
+
return streamToBlob({
|
|
813
|
+
stream,
|
|
814
|
+
...(contentType !== undefined && { type: contentType })
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
return this.#fromDocument(opened.content, opened.meta);
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* @inheritdoc
|
|
821
|
+
*
|
|
822
|
+
* Opens the envelope exactly as {@link decode} does, with the same checks.
|
|
823
|
+
* A chunked document's decrypt stream is handed back unbuffered, so its
|
|
824
|
+
* chunks are fetched and decrypted as the caller reads; a chunk that fails
|
|
825
|
+
* to fetch or verify then errors the stream rather than this call. An
|
|
826
|
+
* inline document is decoded as {@link decode} decodes it and presented as
|
|
827
|
+
* a one-value stream. `contentType` is the sealed plaintext type.
|
|
828
|
+
*
|
|
829
|
+
* @param response {ResponseLike} the stored envelope
|
|
830
|
+
* @param [expectedId] {string} the resource id the read targeted
|
|
831
|
+
* @param [context] {CodecRequestContext} the signed-request context a
|
|
832
|
+
* chunked document's chunks are fetched through
|
|
833
|
+
* @param [chunkSource] {ChunkSource} serves a chunked document's chunks in
|
|
834
|
+
* place of `context`
|
|
835
|
+
* @returns {Promise<DecodedStream>}
|
|
836
|
+
*/
|
|
837
|
+
async decodeStream(response, expectedId, context, chunkSource) {
|
|
838
|
+
const opened = await this.#openStored({
|
|
839
|
+
response,
|
|
840
|
+
expectedId,
|
|
841
|
+
context,
|
|
842
|
+
chunkSource
|
|
843
|
+
});
|
|
844
|
+
if (opened.kind === 'chunked') {
|
|
845
|
+
return this.#chunkedStream(opened.read);
|
|
846
|
+
}
|
|
847
|
+
return decodedStream({
|
|
848
|
+
value: this.#fromDocument(opened.content, opened.meta),
|
|
849
|
+
contentType: sealedContentType(opened.meta)
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* The opening shared by {@link decode} and {@link decodeStream}: refuses an
|
|
854
|
+
* ambiguous chunk route, opens the stored envelope (decrypt, then binding
|
|
855
|
+
* verification), and says whether the document is chunked. A chunked
|
|
856
|
+
* document answers the inputs its chunked read needs; an inline one answers
|
|
857
|
+
* its decrypted `content` and `meta`.
|
|
858
|
+
*
|
|
859
|
+
* @param options {object}
|
|
860
|
+
* @param options.response {ResponseLike} the stored envelope
|
|
861
|
+
* @param [options.expectedId] {string} the resource id the read targeted
|
|
862
|
+
* @param [options.context] {CodecRequestContext} the signed-request context
|
|
863
|
+
* @param [options.chunkSource] {ChunkSource} serves the chunks in place of
|
|
864
|
+
* `context`
|
|
865
|
+
* @returns {Promise<object>}
|
|
866
|
+
*/
|
|
867
|
+
async #openStored({ response, expectedId, context, chunkSource }) {
|
|
791
868
|
if (context !== undefined && chunkSource !== undefined) {
|
|
792
869
|
throw new ValidationError('Cannot decode this resource: both a request context and a ' +
|
|
793
870
|
'`chunkSource` were supplied, so it is ambiguous where a chunked ' +
|
|
@@ -806,23 +883,27 @@ export class EdvCodec {
|
|
|
806
883
|
// is still `{ pending: true }`: it fails loudly rather than decoding to an
|
|
807
884
|
// empty document.
|
|
808
885
|
if (decrypted.meta?.encoding === CHUNKED_ENCODING) {
|
|
809
|
-
return
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
886
|
+
return {
|
|
887
|
+
kind: 'chunked',
|
|
888
|
+
read: {
|
|
889
|
+
// Address the chunk resources by the AEAD-bound `was.resource` id,
|
|
890
|
+
// not by the envelope's cleartext `id`: a server that serves
|
|
891
|
+
// document A's authentic envelope with the cleartext id swapped to B
|
|
892
|
+
// would otherwise have the read fetch (and cleanly decrypt) B's
|
|
893
|
+
// chunks, exactly the envelope swap the `was.resource` binding
|
|
894
|
+
// exists to detect.
|
|
895
|
+
id: decrypted.resourceId,
|
|
896
|
+
chunks: decrypted.stream
|
|
897
|
+
?.chunks,
|
|
898
|
+
meta: decrypted.meta,
|
|
899
|
+
keyId: decrypted.keyId,
|
|
900
|
+
binding: decrypted.binding,
|
|
901
|
+
context,
|
|
902
|
+
chunkSource
|
|
903
|
+
}
|
|
904
|
+
};
|
|
824
905
|
}
|
|
825
|
-
return
|
|
906
|
+
return { kind: 'inline', content: decrypted.content, meta: decrypted.meta };
|
|
826
907
|
}
|
|
827
908
|
/**
|
|
828
909
|
* Whether a stored envelope is a pending stub: the document a chunked write
|
|
@@ -850,11 +931,11 @@ export class EdvCodec {
|
|
|
850
931
|
typeof stream.chunks !== 'number');
|
|
851
932
|
}
|
|
852
933
|
/**
|
|
853
|
-
*
|
|
854
|
-
* over a chunk-reading transport
|
|
855
|
-
*
|
|
856
|
-
* through a transport built from the read context, or from
|
|
857
|
-
* `chunkSource
|
|
934
|
+
* Opens a chunked binary document's decrypt stream: drives
|
|
935
|
+
* `EdvClientCore.getStream` over a chunk-reading transport and returns the
|
|
936
|
+
* stream unbuffered, with the sealed plaintext content type. The chunks come
|
|
937
|
+
* from the server through a transport built from the read context, or from
|
|
938
|
+
* the caller's `chunkSource`, as the stream is read.
|
|
858
939
|
*
|
|
859
940
|
* Only AEAD-authenticated inputs are trusted -- the sealed chunk count and
|
|
860
941
|
* the `was.resource` id the envelope is bound to, never the envelope's
|
|
@@ -876,9 +957,9 @@ export class EdvCodec {
|
|
|
876
957
|
* @param [options.context] {CodecRequestContext} the signed-request context
|
|
877
958
|
* @param [options.chunkSource] {ChunkSource} serves the chunks in place of
|
|
878
959
|
* `context`
|
|
879
|
-
* @returns {Promise<
|
|
960
|
+
* @returns {Promise<DecodedStream>}
|
|
880
961
|
*/
|
|
881
|
-
async #
|
|
962
|
+
async #chunkedStream({ id, chunks, meta, keyId, binding, context, chunkSource }) {
|
|
882
963
|
if (typeof chunks !== 'number') {
|
|
883
964
|
throw new EncryptionError('Cannot read this resource: it is a chunked encrypted blob whose ' +
|
|
884
965
|
'sealed stream state records no chunk count, so the write that ' +
|
|
@@ -920,11 +1001,8 @@ export class EdvCodec {
|
|
|
920
1001
|
keyAgreementKey,
|
|
921
1002
|
transport: new ChunkReadTransport({ fetchChunk, binding })
|
|
922
1003
|
}));
|
|
923
|
-
const contentType =
|
|
924
|
-
return
|
|
925
|
-
stream,
|
|
926
|
-
...(contentType !== undefined && { type: contentType })
|
|
927
|
-
});
|
|
1004
|
+
const contentType = sealedContentType(meta);
|
|
1005
|
+
return { stream, ...(contentType !== undefined && { contentType }) };
|
|
928
1006
|
}
|
|
929
1007
|
/**
|
|
930
1008
|
* Opens a stored envelope: asserts it IS an EDV envelope, decrypts it with
|
|
@@ -1357,7 +1435,10 @@ export class EdvCodec {
|
|
|
1357
1435
|
* for messages) and the `meta` the chunked-stream path seals, and the caller
|
|
1358
1436
|
* routes the write there. The routing decision is made on the payload's size
|
|
1359
1437
|
* alone, so a `Blob` over the threshold is never buffered here: it is handed
|
|
1360
|
-
* on as `blob.stream()`, and the EDV core re-chunks it as it reads.
|
|
1438
|
+
* on as `blob.stream()`, and the EDV core re-chunks it as it reads. A
|
|
1439
|
+
* `ReadableStream` payload answers `kind: 'chunked'` unconditionally, with
|
|
1440
|
+
* no `size`: its size is unknown until it is read, so the threshold cannot
|
|
1441
|
+
* apply, and it is handed on unread.
|
|
1361
1442
|
*
|
|
1362
1443
|
* A bare primitive is rejected (mirroring the plaintext `prepareBody`
|
|
1363
1444
|
* contract). The binary/text detection and content-type precedence are the
|
|
@@ -1369,10 +1450,17 @@ export class EdvCodec {
|
|
|
1369
1450
|
* @param [id] {string} resource id, for the extension guess
|
|
1370
1451
|
* @returns {Promise<object>} the inline document `{ content, meta }`, or
|
|
1371
1452
|
* the `{ stream, size, meta }` of a payload to route to the chunked-stream
|
|
1372
|
-
* path
|
|
1453
|
+
* path (`size` absent for a stream payload)
|
|
1373
1454
|
*/
|
|
1374
1455
|
async #toDocument(data, contentType, id) {
|
|
1375
1456
|
const payload = resolvePayload({ data, contentType, id });
|
|
1457
|
+
if (payload.kind === 'stream') {
|
|
1458
|
+
return {
|
|
1459
|
+
kind: 'chunked',
|
|
1460
|
+
stream: payload.data,
|
|
1461
|
+
meta: { contentType: payload.contentType, encoding: CHUNKED_ENCODING }
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1376
1464
|
if (payload.kind === 'binary') {
|
|
1377
1465
|
const resolvedType = payload.contentType;
|
|
1378
1466
|
// Route on the size alone (`Blob.size` is synchronous), so an
|
|
@@ -1383,12 +1471,14 @@ export class EdvCodec {
|
|
|
1383
1471
|
if (size > this.#maxBlobBytes) {
|
|
1384
1472
|
// Too large for one document: route it to the chunked-stream path,
|
|
1385
1473
|
// where the bytes live in the document's own chunk resources. Hand it
|
|
1386
|
-
// over as a stream
|
|
1387
|
-
//
|
|
1388
|
-
//
|
|
1474
|
+
// over as a stream. A `Blob` is immutable and streams itself, so it is
|
|
1475
|
+
// not held twice while the EDV core re-chunks it. A `Uint8Array` is
|
|
1476
|
+
// snapshotted once into a one-value stream: the chunks are encrypted
|
|
1477
|
+
// across one server round-trip each, and the caller may reuse its
|
|
1478
|
+
// buffer before the write resolves.
|
|
1389
1479
|
return {
|
|
1390
1480
|
kind: 'chunked',
|
|
1391
|
-
stream: bytesToStream(payload.data),
|
|
1481
|
+
stream: bytesToStream(isBlob(payload.data) ? payload.data : new Uint8Array(payload.data)),
|
|
1392
1482
|
size,
|
|
1393
1483
|
meta: { contentType: resolvedType, encoding: CHUNKED_ENCODING }
|
|
1394
1484
|
};
|
|
@@ -1426,8 +1516,8 @@ export class EdvCodec {
|
|
|
1426
1516
|
meta: { contentType: contentType ?? 'application/json' }
|
|
1427
1517
|
};
|
|
1428
1518
|
}
|
|
1429
|
-
throw new ValidationError('Encrypted resource data must be a plain object/array (JSON)
|
|
1430
|
-
'Blob/Uint8Array (binary)
|
|
1519
|
+
throw new ValidationError('Encrypted resource data must be a plain object/array (JSON), a ' +
|
|
1520
|
+
'Blob/Uint8Array (binary), or a ReadableStream<Uint8Array>.');
|
|
1431
1521
|
}
|
|
1432
1522
|
/**
|
|
1433
1523
|
* Reconstructs a caller value from a decrypted EDV document, discriminating
|
|
@@ -1451,7 +1541,7 @@ export class EdvCodec {
|
|
|
1451
1541
|
*/
|
|
1452
1542
|
#fromDocument(content, meta) {
|
|
1453
1543
|
const encoding = meta?.encoding;
|
|
1454
|
-
const contentType =
|
|
1544
|
+
const contentType = sealedContentType(meta);
|
|
1455
1545
|
if (encoding === 'utf-8') {
|
|
1456
1546
|
const text = content?.text;
|
|
1457
1547
|
if (typeof text !== 'string') {
|
|
@@ -1482,18 +1572,14 @@ export class EdvCodec {
|
|
|
1482
1572
|
}
|
|
1483
1573
|
}
|
|
1484
1574
|
/**
|
|
1485
|
-
*
|
|
1486
|
-
* `
|
|
1487
|
-
* already in hand are wrapped in a `Blob` and stream the same way. The encrypt
|
|
1488
|
-
* stream re-chunks whatever it is fed at its own `chunkSize`, so the shape of
|
|
1489
|
-
* the source stream does not affect the stored chunks.
|
|
1575
|
+
* The plaintext content type sealed in a decrypted document's `meta`, or
|
|
1576
|
+
* `undefined` when it records none.
|
|
1490
1577
|
*
|
|
1491
|
-
* @param
|
|
1492
|
-
* @returns {
|
|
1578
|
+
* @param [meta] {Record<string, unknown>}
|
|
1579
|
+
* @returns {string | undefined}
|
|
1493
1580
|
*/
|
|
1494
|
-
function
|
|
1495
|
-
|
|
1496
|
-
return blob.stream();
|
|
1581
|
+
function sealedContentType(meta) {
|
|
1582
|
+
return typeof meta?.contentType === 'string' ? meta.contentType : undefined;
|
|
1497
1583
|
}
|
|
1498
1584
|
/**
|
|
1499
1585
|
* Drains a byte stream into one `Blob` of the given type. `Blob` does the
|
|
@@ -1505,18 +1591,8 @@ function bytesToStream(data) {
|
|
|
1505
1591
|
* @returns {Promise<Blob>}
|
|
1506
1592
|
*/
|
|
1507
1593
|
async function streamToBlob({ stream, type }) {
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1510
|
-
for (;;) {
|
|
1511
|
-
const { value, done } = await reader.read();
|
|
1512
|
-
if (done) {
|
|
1513
|
-
break;
|
|
1514
|
-
}
|
|
1515
|
-
if (value !== undefined) {
|
|
1516
|
-
parts.push(value);
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
return new Blob(parts, type !== undefined ? { type } : undefined);
|
|
1594
|
+
const bytes = await new Response(stream).arrayBuffer();
|
|
1595
|
+
return new Blob([bytes], type !== undefined ? { type } : undefined);
|
|
1520
1596
|
}
|
|
1521
1597
|
/**
|
|
1522
1598
|
* The edv-client `Transport` a chunked read runs on. It serves only
|