@trylimbo/sdk-verifier-wasm 0.2.11-canary.16 → 0.2.11-canary.18
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/gen/wasm/trylimbo_sdk_verifier.d.ts +88 -55
- package/gen/wasm/trylimbo_sdk_verifier.js +15 -5
- package/gen/wasm/trylimbo_sdk_verifier_bg.wasm +0 -0
- package/gen/wasm/trylimbo_sdk_verifier_bg.wasm.d.ts +7 -7
- package/gen/wasm/worker-thread.js +14 -5
- package/gen/wasm/worker.d.ts +94 -59
- package/package.json +1 -1
|
@@ -81,11 +81,6 @@ export interface SessionKeySummary {
|
|
|
81
81
|
publicKey: Uint8Array;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/**
|
|
85
|
-
* A single C2PA Soft Binding Resolution API lookup.
|
|
86
|
-
*/
|
|
87
|
-
export type RecoveryQuery = { byBinding: { binderIndex: number } } | { byContent: { algorithm: ContentAlgorithm; hintBinderIndex?: number } };
|
|
88
|
-
|
|
89
84
|
/**
|
|
90
85
|
* A status with no structured detail (`kind: \"status\"`).
|
|
91
86
|
*/
|
|
@@ -163,11 +158,6 @@ export interface StreamVerifierOptions {
|
|
|
163
158
|
segmentSkewToleranceSecs?: number;
|
|
164
159
|
}
|
|
165
160
|
|
|
166
|
-
/**
|
|
167
|
-
* How a `byContent` query selects the registry\'s detector algorithms.
|
|
168
|
-
*/
|
|
169
|
-
export type ContentAlgorithm = "fingerprint" | "watermark" | "all" | { named: { algorithm: string } };
|
|
170
|
-
|
|
171
161
|
/**
|
|
172
162
|
* One C2PA validation status entry (spec §15.3).
|
|
173
163
|
*/
|
|
@@ -188,6 +178,32 @@ export interface FieldViolation {
|
|
|
188
178
|
reason: string;
|
|
189
179
|
}
|
|
190
180
|
|
|
181
|
+
/**
|
|
182
|
+
* One `matches/byContent` upload per selected detector.
|
|
183
|
+
*/
|
|
184
|
+
export interface ByContent {
|
|
185
|
+
after: ContentTrigger;
|
|
186
|
+
detectors: Detectors;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* One `matches/byReference` query per selected detector. The registry downloads the asset
|
|
191
|
+
* from `url`, so the client reads no bytes for it.
|
|
192
|
+
*/
|
|
193
|
+
export interface ByReference {
|
|
194
|
+
after: ContentTrigger;
|
|
195
|
+
detectors: Detectors;
|
|
196
|
+
/**
|
|
197
|
+
* A short-lived https URL without credentials.
|
|
198
|
+
*/
|
|
199
|
+
url: string;
|
|
200
|
+
/**
|
|
201
|
+
* The asset\'s size in bytes, which caps the registry\'s download.
|
|
202
|
+
*/
|
|
203
|
+
length: number;
|
|
204
|
+
mediaType?: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
191
207
|
/**
|
|
192
208
|
* One `verify` credential: the c2pa `ManifestStore`, where it came from, whether the asset\'s
|
|
193
209
|
* own fingerprint backs it up, and whether its hard binding holds over the bytes read.
|
|
@@ -212,24 +228,10 @@ export interface FoundCredential {
|
|
|
212
228
|
* Whether the manifest\'s hard binding holds over the bytes this verify read.
|
|
213
229
|
*/
|
|
214
230
|
hardBinding: HardBinding;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* One ordered group of registry queries.
|
|
219
|
-
*/
|
|
220
|
-
export interface RecoveryStage {
|
|
221
|
-
/**
|
|
222
|
-
* Queries in declaration order. Their order is also the deterministic result priority.
|
|
223
|
-
*/
|
|
224
|
-
queries: RecoveryQuery[];
|
|
225
|
-
/**
|
|
226
|
-
* Whether queries start one at a time or together.
|
|
227
|
-
*/
|
|
228
|
-
execution: RecoveryExecution;
|
|
229
231
|
/**
|
|
230
|
-
*
|
|
232
|
+
* Where this credential sits among the others returned. See [`crate::asset::Lineage`].
|
|
231
233
|
*/
|
|
232
|
-
|
|
234
|
+
lineage: Lineage;
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
/**
|
|
@@ -258,16 +260,6 @@ export interface InitValidation {
|
|
|
258
260
|
*/
|
|
259
261
|
export type SegmentValidation = ({ kind: "init" } & InitValidation) | ({ kind: "media" } & MediaValidation) | { kind: "unknown" };
|
|
260
262
|
|
|
261
|
-
/**
|
|
262
|
-
* Scheduling within a recovery stage.
|
|
263
|
-
*/
|
|
264
|
-
export type RecoveryExecution = "sequential" | "parallel";
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* The condition that completes a recovery stage.
|
|
268
|
-
*/
|
|
269
|
-
export type RecoveryCompletion = "firstResult" | "allResults";
|
|
270
|
-
|
|
271
263
|
/**
|
|
272
264
|
* The error every SDK call throws: a decoded `google.rpc.Status`, discriminated
|
|
273
265
|
* by `kind`. A consumer switches on `err.kind` (`\"reason\" | \"invalid\" | \"status\"`)
|
|
@@ -276,11 +268,6 @@ export type RecoveryCompletion = "firstResult" | "allResults";
|
|
|
276
268
|
*/
|
|
277
269
|
export type SdkError = ({ kind: "status" } & StatusError) | ({ kind: "reason" } & ReasonError) | ({ kind: "invalid" } & InvalidError);
|
|
278
270
|
|
|
279
|
-
/**
|
|
280
|
-
* The registry work a verification call is allowed to perform.
|
|
281
|
-
*/
|
|
282
|
-
export type RecoveryPlan = { custom: { stages: RecoveryStage[] } };
|
|
283
|
-
|
|
284
271
|
/**
|
|
285
272
|
* Timing facts carried by a media segment\'s container.
|
|
286
273
|
*/
|
|
@@ -299,13 +286,38 @@ export interface SegmentTiming {
|
|
|
299
286
|
eventDurationSecs?: number;
|
|
300
287
|
}
|
|
301
288
|
|
|
289
|
+
/**
|
|
290
|
+
* What one verify may do with the registry. Required whenever a registry is configured.
|
|
291
|
+
*
|
|
292
|
+
* One field per Soft Binding Resolution API operation, and an absent one is not called.
|
|
293
|
+
* `matches/byBinding` is decided by the binders handed to the verify: each is derived and looked
|
|
294
|
+
* up, all together, and every result is kept. The content forms run after that, each for the
|
|
295
|
+
* detectors it names, hinted with the first fingerprint the binders derived. Results merge by
|
|
296
|
+
* manifest; nothing is ranked or dropped.
|
|
297
|
+
*/
|
|
298
|
+
export interface Recovery {
|
|
299
|
+
/**
|
|
300
|
+
* When the registry is consulted at all.
|
|
301
|
+
*/
|
|
302
|
+
when: RecoveryPolicy;
|
|
303
|
+
/**
|
|
304
|
+
* `matches/byContent`: the bounded asset bytes travel in the request.
|
|
305
|
+
*/
|
|
306
|
+
byContent?: ByContent;
|
|
307
|
+
/**
|
|
308
|
+
* `matches/byReference`: the registry fetches the asset from the caller\'s URL instead, for
|
|
309
|
+
* an asset above the upload cap.
|
|
310
|
+
*/
|
|
311
|
+
byReference?: ByReference;
|
|
312
|
+
}
|
|
313
|
+
|
|
302
314
|
/**
|
|
303
315
|
* When [`AssetVerifier::verify_asset`] queries the registry.
|
|
304
316
|
*/
|
|
305
317
|
export type RecoveryPolicy = "whenMissing" | "always";
|
|
306
318
|
|
|
307
319
|
/**
|
|
308
|
-
* Where the registry is
|
|
320
|
+
* Where the registry is. What a verify may do with it is per call, in [`Recovery`].
|
|
309
321
|
*/
|
|
310
322
|
export interface RegistryOptions {
|
|
311
323
|
/**
|
|
@@ -313,9 +325,11 @@ export interface RegistryOptions {
|
|
|
313
325
|
*/
|
|
314
326
|
url: string;
|
|
315
327
|
/**
|
|
316
|
-
*
|
|
328
|
+
* Federated resolution APIs a match may name as holding its manifest. C2PA 2.4 lets a
|
|
329
|
+
* match carry an `endpoint`; one listed here is fetched from, any other is reported as
|
|
330
|
+
* refused. Checked like `url`: https, or http on loopback only.
|
|
317
331
|
*/
|
|
318
|
-
|
|
332
|
+
endpoints?: string[];
|
|
319
333
|
}
|
|
320
334
|
|
|
321
335
|
/**
|
|
@@ -323,6 +337,17 @@ export interface RegistryOptions {
|
|
|
323
337
|
*/
|
|
324
338
|
export type ValidationCodeKind = "success" | "informational" | "failure";
|
|
325
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Whether a content form runs on this verify. Judged against the byBinding results alone.
|
|
342
|
+
*/
|
|
343
|
+
export type ContentTrigger = "byBindingMisses" | "always";
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Which advertised server-side detectors a content form runs. Every selected detector runs,
|
|
347
|
+
* including one a local binder already queried by binding.
|
|
348
|
+
*/
|
|
349
|
+
export type Detectors = { kind: "fingerprint" } | { kind: "watermark" } | { kind: "all" } | { kind: "named"; algorithms: string[] };
|
|
350
|
+
|
|
326
351
|
/**
|
|
327
352
|
* [`crate::asset::CredentialOrigin`] as JS sees it: a tagged union, since each way of finding a
|
|
328
353
|
* credential carries different evidence. Lane-local for the same reason [`FingerprintCheck`] is: a
|
|
@@ -342,6 +367,14 @@ export type FingerprintCheck = { kind: "notNeeded" } | { kind: "nothingToCompare
|
|
|
342
367
|
*/
|
|
343
368
|
export type HardBinding = "holds" | "mismatch";
|
|
344
369
|
|
|
370
|
+
/**
|
|
371
|
+
* [`crate::asset::Lineage`] as JS sees it.
|
|
372
|
+
*/
|
|
373
|
+
export interface Lineage {
|
|
374
|
+
supersedes: string[];
|
|
375
|
+
supersededBy: string[];
|
|
376
|
+
}
|
|
377
|
+
|
|
345
378
|
export interface AssetVerification {
|
|
346
379
|
credentials: FoundCredential[];
|
|
347
380
|
recovery: RecoverySummary;
|
|
@@ -364,9 +397,9 @@ export type ContentBindingClass = "fingerprint" | "watermark";
|
|
|
364
397
|
|
|
365
398
|
export type GoldenComparison = { kind: "notRequested" } | { kind: "noEmbeddedManifest" } | { kind: "noRecoveredManifest" } | { kind: "matches"; recoveredIndex: number } | { kind: "differs"; recoveredIndex: number } | { kind: "indeterminate"; recoveredIndex: number | undefined };
|
|
366
399
|
|
|
367
|
-
export type RecoveryDiscovery = { method: "byBinding"; class: ContentBindingClass; binding: SoftBinding; binderIndex: number; registryScore: number | undefined } | { method: "byContent"; hint: SoftBinding | undefined; class: ContentBindingClass; algorithm: string; registryScore: number | undefined };
|
|
400
|
+
export type RecoveryDiscovery = { method: "byBinding"; class: ContentBindingClass; binding: SoftBinding; binderIndex: number; registryScore: number | undefined; endpoint: string | undefined } | { method: "byContent"; hint: SoftBinding | undefined; class: ContentBindingClass; algorithm: string; registryScore: number | undefined; endpoint: string | undefined } | { method: "byReference"; hint: SoftBinding | undefined; class: ContentBindingClass; algorithm: string; registryScore: number | undefined; endpoint: string | undefined };
|
|
368
401
|
|
|
369
|
-
export type RecoveryIssueKind = "binder" | "bindingQuery" | "queryRefused" | "contentQuery" | "capabilities" | "contentTooLarge" | "candidateFetch" | "candidateValidation" | "resourceLimit";
|
|
402
|
+
export type RecoveryIssueKind = "binder" | "bindingQuery" | "queryRefused" | "contentQuery" | "capabilities" | "contentTooLarge" | "candidateFetch" | "candidateValidation" | "resourceLimit" | "endpointRefused";
|
|
370
403
|
|
|
371
404
|
export type RecoveryStatus = "notRequested" | "notFound" | "recovered" | "incomplete";
|
|
372
405
|
|
|
@@ -601,12 +634,12 @@ export class StreamVerifier {
|
|
|
601
634
|
}
|
|
602
635
|
|
|
603
636
|
/**
|
|
604
|
-
* Per-call soft-binding inputs.
|
|
637
|
+
* Per-call soft-binding inputs. `recovery` is required when the verifier has a registry.
|
|
605
638
|
*/
|
|
606
639
|
export class VerifyOptions {
|
|
607
640
|
free(): void;
|
|
608
641
|
[Symbol.dispose](): void;
|
|
609
|
-
constructor(binders: Binder[],
|
|
642
|
+
constructor(binders: Binder[], recovery?: Recovery | null);
|
|
610
643
|
}
|
|
611
644
|
|
|
612
645
|
export function init_panic_hook(): void;
|
|
@@ -661,16 +694,12 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
661
694
|
|
|
662
695
|
export interface InitOutput {
|
|
663
696
|
readonly memory: WebAssembly.Memory;
|
|
664
|
-
readonly __wbg_assetverifier_free: (a: number, b: number) => void;
|
|
665
697
|
readonly __wbg_binder_free: (a: number, b: number) => void;
|
|
666
698
|
readonly __wbg_blobsource_free: (a: number, b: number) => void;
|
|
667
699
|
readonly __wbg_bytessource_free: (a: number, b: number) => void;
|
|
668
700
|
readonly __wbg_memorysource_free: (a: number, b: number) => void;
|
|
669
701
|
readonly __wbg_streamvalidation_free: (a: number, b: number) => void;
|
|
670
702
|
readonly __wbg_streamverifier_free: (a: number, b: number) => void;
|
|
671
|
-
readonly __wbg_verifyoptions_free: (a: number, b: number) => void;
|
|
672
|
-
readonly assetverifier_create: (a: any) => [number, number, number];
|
|
673
|
-
readonly assetverifier_verify: (a: number, b: any, c: number) => any;
|
|
674
703
|
readonly binder_derive: (a: number, b: any, c: number, d: number) => any;
|
|
675
704
|
readonly binder_held: (a: any) => [number, number, number];
|
|
676
705
|
readonly binder_iscc: () => number;
|
|
@@ -683,19 +712,23 @@ export interface InitOutput {
|
|
|
683
712
|
readonly memorysource_length: (a: number) => number;
|
|
684
713
|
readonly memorysource_new: (a: number, b: number) => number;
|
|
685
714
|
readonly memorysource_readAt: (a: number, b: number, c: number) => any;
|
|
715
|
+
readonly parse: (a: number, b: number) => [number, number, number];
|
|
716
|
+
readonly resource: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
686
717
|
readonly streamvalidation_export: (a: number) => [number, number, number, number];
|
|
687
718
|
readonly streamvalidation_validate: (a: number, b: any) => any;
|
|
688
719
|
readonly streamverifier_create: (a: any) => [number, number, number];
|
|
689
720
|
readonly streamverifier_open: (a: number, b: number, c: number) => number;
|
|
690
721
|
readonly streamverifier_resume: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
722
|
+
readonly thumbnails: (a: number, b: number) => [number, number, number];
|
|
723
|
+
readonly __wbg_assetverifier_free: (a: number, b: number) => void;
|
|
724
|
+
readonly __wbg_verifyoptions_free: (a: number, b: number) => void;
|
|
725
|
+
readonly assetverifier_create: (a: any) => [number, number, number];
|
|
726
|
+
readonly assetverifier_verify: (a: number, b: any, c: number) => any;
|
|
691
727
|
readonly verifyoptions_new: (a: number, b: number, c: number) => number;
|
|
692
728
|
readonly C2PA_TRUST_LIST: () => [number, number];
|
|
693
729
|
readonly C2PA_TSA_TRUST_LIST: () => [number, number];
|
|
694
730
|
readonly DEV_CA: () => [number, number];
|
|
695
731
|
readonly init_panic_hook: () => void;
|
|
696
|
-
readonly parse: (a: number, b: number) => [number, number, number];
|
|
697
|
-
readonly resource: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
698
|
-
readonly thumbnails: (a: number, b: number) => [number, number, number];
|
|
699
732
|
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
700
733
|
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
701
734
|
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
@@ -590,7 +590,7 @@ export class StreamVerifier {
|
|
|
590
590
|
if (Symbol.dispose) StreamVerifier.prototype[Symbol.dispose] = StreamVerifier.prototype.free;
|
|
591
591
|
|
|
592
592
|
/**
|
|
593
|
-
* Per-call soft-binding inputs.
|
|
593
|
+
* Per-call soft-binding inputs. `recovery` is required when the verifier has a registry.
|
|
594
594
|
*/
|
|
595
595
|
export class VerifyOptions {
|
|
596
596
|
__destroy_into_raw() {
|
|
@@ -605,12 +605,12 @@ export class VerifyOptions {
|
|
|
605
605
|
}
|
|
606
606
|
/**
|
|
607
607
|
* @param {Binder[]} binders
|
|
608
|
-
* @param {
|
|
608
|
+
* @param {Recovery | null} [recovery]
|
|
609
609
|
*/
|
|
610
|
-
constructor(binders,
|
|
610
|
+
constructor(binders, recovery) {
|
|
611
611
|
const ptr0 = passArrayJsValueToWasm0(binders, wasm.__wbindgen_malloc);
|
|
612
612
|
const len0 = WASM_VECTOR_LEN;
|
|
613
|
-
const ret = wasm.verifyoptions_new(ptr0, len0, isLikeNone(
|
|
613
|
+
const ret = wasm.verifyoptions_new(ptr0, len0, isLikeNone(recovery) ? 0 : addToExternrefTable0(recovery));
|
|
614
614
|
this.__wbg_ptr = ret;
|
|
615
615
|
VerifyOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
616
616
|
return this;
|
|
@@ -967,6 +967,16 @@ function __wbg_get_imports() {
|
|
|
967
967
|
const ret = result;
|
|
968
968
|
return ret;
|
|
969
969
|
},
|
|
970
|
+
__wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
|
|
971
|
+
let result;
|
|
972
|
+
try {
|
|
973
|
+
result = arg0 instanceof Map;
|
|
974
|
+
} catch (_) {
|
|
975
|
+
result = false;
|
|
976
|
+
}
|
|
977
|
+
const ret = result;
|
|
978
|
+
return ret;
|
|
979
|
+
},
|
|
970
980
|
__wbg_instanceof_Promise_4cb210c0b8f8c959: function(arg0) {
|
|
971
981
|
let result;
|
|
972
982
|
try {
|
|
@@ -1274,7 +1284,7 @@ function __wbg_get_imports() {
|
|
|
1274
1284
|
return ret;
|
|
1275
1285
|
},
|
|
1276
1286
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1277
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1287
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3940, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1278
1288
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hedf60f9cb8ab20c3);
|
|
1279
1289
|
return ret;
|
|
1280
1290
|
},
|
|
Binary file
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_assetverifier_free: (a: number, b: number) => void;
|
|
5
4
|
export const __wbg_binder_free: (a: number, b: number) => void;
|
|
6
5
|
export const __wbg_blobsource_free: (a: number, b: number) => void;
|
|
7
6
|
export const __wbg_bytessource_free: (a: number, b: number) => void;
|
|
8
7
|
export const __wbg_memorysource_free: (a: number, b: number) => void;
|
|
9
8
|
export const __wbg_streamvalidation_free: (a: number, b: number) => void;
|
|
10
9
|
export const __wbg_streamverifier_free: (a: number, b: number) => void;
|
|
11
|
-
export const __wbg_verifyoptions_free: (a: number, b: number) => void;
|
|
12
|
-
export const assetverifier_create: (a: any) => [number, number, number];
|
|
13
|
-
export const assetverifier_verify: (a: number, b: any, c: number) => any;
|
|
14
10
|
export const binder_derive: (a: number, b: any, c: number, d: number) => any;
|
|
15
11
|
export const binder_held: (a: any) => [number, number, number];
|
|
16
12
|
export const binder_iscc: () => number;
|
|
@@ -23,19 +19,23 @@ export const bytessource_readAt: (a: number, b: number, c: number) => any;
|
|
|
23
19
|
export const memorysource_length: (a: number) => number;
|
|
24
20
|
export const memorysource_new: (a: number, b: number) => number;
|
|
25
21
|
export const memorysource_readAt: (a: number, b: number, c: number) => any;
|
|
22
|
+
export const parse: (a: number, b: number) => [number, number, number];
|
|
23
|
+
export const resource: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
26
24
|
export const streamvalidation_export: (a: number) => [number, number, number, number];
|
|
27
25
|
export const streamvalidation_validate: (a: number, b: any) => any;
|
|
28
26
|
export const streamverifier_create: (a: any) => [number, number, number];
|
|
29
27
|
export const streamverifier_open: (a: number, b: number, c: number) => number;
|
|
30
28
|
export const streamverifier_resume: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
29
|
+
export const thumbnails: (a: number, b: number) => [number, number, number];
|
|
30
|
+
export const __wbg_assetverifier_free: (a: number, b: number) => void;
|
|
31
|
+
export const __wbg_verifyoptions_free: (a: number, b: number) => void;
|
|
32
|
+
export const assetverifier_create: (a: any) => [number, number, number];
|
|
33
|
+
export const assetverifier_verify: (a: number, b: any, c: number) => any;
|
|
31
34
|
export const verifyoptions_new: (a: number, b: number, c: number) => number;
|
|
32
35
|
export const C2PA_TRUST_LIST: () => [number, number];
|
|
33
36
|
export const C2PA_TSA_TRUST_LIST: () => [number, number];
|
|
34
37
|
export const DEV_CA: () => [number, number];
|
|
35
38
|
export const init_panic_hook: () => void;
|
|
36
|
-
export const parse: (a: number, b: number) => [number, number, number];
|
|
37
|
-
export const resource: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
38
|
-
export const thumbnails: (a: number, b: number) => [number, number, number];
|
|
39
39
|
export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
40
40
|
export const intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
41
41
|
export const intounderlyingbytesource_cancel: (a: number) => void;
|
|
@@ -547,7 +547,7 @@ var StreamVerifier = class StreamVerifier {
|
|
|
547
547
|
};
|
|
548
548
|
if (Symbol.dispose) StreamVerifier.prototype[Symbol.dispose] = StreamVerifier.prototype.free;
|
|
549
549
|
/**
|
|
550
|
-
* Per-call soft-binding inputs.
|
|
550
|
+
* Per-call soft-binding inputs. `recovery` is required when the verifier has a registry.
|
|
551
551
|
*/
|
|
552
552
|
var VerifyOptions = class {
|
|
553
553
|
__destroy_into_raw() {
|
|
@@ -562,12 +562,12 @@ var VerifyOptions = class {
|
|
|
562
562
|
}
|
|
563
563
|
/**
|
|
564
564
|
* @param {Binder[]} binders
|
|
565
|
-
* @param {
|
|
565
|
+
* @param {Recovery | null} [recovery]
|
|
566
566
|
*/
|
|
567
|
-
constructor(binders,
|
|
567
|
+
constructor(binders, recovery) {
|
|
568
568
|
const ptr0 = passArrayJsValueToWasm0(binders, wasm.__wbindgen_malloc);
|
|
569
569
|
const len0 = WASM_VECTOR_LEN;
|
|
570
|
-
const ret = wasm.verifyoptions_new(ptr0, len0, isLikeNone(
|
|
570
|
+
const ret = wasm.verifyoptions_new(ptr0, len0, isLikeNone(recovery) ? 0 : addToExternrefTable0(recovery));
|
|
571
571
|
this.__wbg_ptr = ret;
|
|
572
572
|
VerifyOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
573
573
|
return this;
|
|
@@ -900,6 +900,15 @@ function __wbg_get_imports() {
|
|
|
900
900
|
}
|
|
901
901
|
return result;
|
|
902
902
|
},
|
|
903
|
+
__wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
|
|
904
|
+
let result;
|
|
905
|
+
try {
|
|
906
|
+
result = arg0 instanceof Map;
|
|
907
|
+
} catch (_) {
|
|
908
|
+
result = false;
|
|
909
|
+
}
|
|
910
|
+
return result;
|
|
911
|
+
},
|
|
903
912
|
__wbg_instanceof_Promise_4cb210c0b8f8c959: function(arg0) {
|
|
904
913
|
let result;
|
|
905
914
|
try {
|
|
@@ -1567,7 +1576,7 @@ var Handle = class {
|
|
|
1567
1576
|
};
|
|
1568
1577
|
var AssetVerifierHandle = class extends Handle {
|
|
1569
1578
|
verify(asset, options = {}) {
|
|
1570
|
-
return this.inner.verify(source(asset), new VerifyOptions((options.binders ?? []).map(binder), options.
|
|
1579
|
+
return this.inner.verify(source(asset), new VerifyOptions((options.binders ?? []).map(binder), options.recovery));
|
|
1571
1580
|
}
|
|
1572
1581
|
};
|
|
1573
1582
|
/** One stream being validated. Dropping the handle releases the session it accumulated. */
|
package/gen/wasm/worker.d.ts
CHANGED
|
@@ -194,19 +194,6 @@ interface SessionKeySummary {
|
|
|
194
194
|
*/
|
|
195
195
|
publicKey: Uint8Array;
|
|
196
196
|
}
|
|
197
|
-
/**
|
|
198
|
-
* A single C2PA Soft Binding Resolution API lookup.
|
|
199
|
-
*/
|
|
200
|
-
type RecoveryQuery = {
|
|
201
|
-
byBinding: {
|
|
202
|
-
binderIndex: number;
|
|
203
|
-
};
|
|
204
|
-
} | {
|
|
205
|
-
byContent: {
|
|
206
|
-
algorithm: ContentAlgorithm;
|
|
207
|
-
hintBinderIndex?: number;
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
197
|
/**
|
|
211
198
|
* C2PA validation state of a manifest (spec §14.3).
|
|
212
199
|
*/
|
|
@@ -273,14 +260,6 @@ interface StreamVerifierOptions {
|
|
|
273
260
|
*/
|
|
274
261
|
segmentSkewToleranceSecs?: number;
|
|
275
262
|
}
|
|
276
|
-
/**
|
|
277
|
-
* How a `byContent` query selects the registry\'s detector algorithms.
|
|
278
|
-
*/
|
|
279
|
-
type ContentAlgorithm = "fingerprint" | "watermark" | "all" | {
|
|
280
|
-
named: {
|
|
281
|
-
algorithm: string;
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
263
|
/**
|
|
285
264
|
* One C2PA validation status entry (spec §15.3).
|
|
286
265
|
*/
|
|
@@ -291,6 +270,30 @@ interface ValidationCode {
|
|
|
291
270
|
code: string;
|
|
292
271
|
kind: ValidationCodeKind;
|
|
293
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* One `matches/byContent` upload per selected detector.
|
|
275
|
+
*/
|
|
276
|
+
interface ByContent {
|
|
277
|
+
after: ContentTrigger;
|
|
278
|
+
detectors: Detectors;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* One `matches/byReference` query per selected detector. The registry downloads the asset
|
|
282
|
+
* from `url`, so the client reads no bytes for it.
|
|
283
|
+
*/
|
|
284
|
+
interface ByReference {
|
|
285
|
+
after: ContentTrigger;
|
|
286
|
+
detectors: Detectors;
|
|
287
|
+
/**
|
|
288
|
+
* A short-lived https URL without credentials.
|
|
289
|
+
*/
|
|
290
|
+
url: string;
|
|
291
|
+
/**
|
|
292
|
+
* The asset\'s size in bytes, which caps the registry\'s download.
|
|
293
|
+
*/
|
|
294
|
+
length: number;
|
|
295
|
+
mediaType?: string;
|
|
296
|
+
}
|
|
294
297
|
/**
|
|
295
298
|
* One `verify` credential: the c2pa `ManifestStore`, where it came from, whether the asset\'s
|
|
296
299
|
* own fingerprint backs it up, and whether its hard binding holds over the bytes read.
|
|
@@ -315,23 +318,10 @@ interface FoundCredential {
|
|
|
315
318
|
* Whether the manifest\'s hard binding holds over the bytes this verify read.
|
|
316
319
|
*/
|
|
317
320
|
hardBinding: HardBinding;
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* One ordered group of registry queries.
|
|
321
|
-
*/
|
|
322
|
-
interface RecoveryStage {
|
|
323
321
|
/**
|
|
324
|
-
*
|
|
322
|
+
* Where this credential sits among the others returned. See [`crate::asset::Lineage`].
|
|
325
323
|
*/
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Whether queries start one at a time or together.
|
|
329
|
-
*/
|
|
330
|
-
execution: RecoveryExecution;
|
|
331
|
-
/**
|
|
332
|
-
* Whether this stage stops at its first successful query or retains every result.
|
|
333
|
-
*/
|
|
334
|
-
completion: RecoveryCompletion;
|
|
324
|
+
lineage: Lineage;
|
|
335
325
|
}
|
|
336
326
|
/**
|
|
337
327
|
* Outcome of validating a media segment against its stream\'s init.
|
|
@@ -362,22 +352,6 @@ type SegmentValidation = ({
|
|
|
362
352
|
} & MediaValidation) | {
|
|
363
353
|
kind: "unknown";
|
|
364
354
|
};
|
|
365
|
-
/**
|
|
366
|
-
* Scheduling within a recovery stage.
|
|
367
|
-
*/
|
|
368
|
-
type RecoveryExecution = "sequential" | "parallel";
|
|
369
|
-
/**
|
|
370
|
-
* The condition that completes a recovery stage.
|
|
371
|
-
*/
|
|
372
|
-
type RecoveryCompletion = "firstResult" | "allResults";
|
|
373
|
-
/**
|
|
374
|
-
* The registry work a verification call is allowed to perform.
|
|
375
|
-
*/
|
|
376
|
-
type RecoveryPlan = {
|
|
377
|
-
custom: {
|
|
378
|
-
stages: RecoveryStage[];
|
|
379
|
-
};
|
|
380
|
-
};
|
|
381
355
|
/**
|
|
382
356
|
* Timing facts carried by a media segment\'s container.
|
|
383
357
|
*/
|
|
@@ -395,12 +369,36 @@ interface SegmentTiming {
|
|
|
395
369
|
*/
|
|
396
370
|
eventDurationSecs?: number;
|
|
397
371
|
}
|
|
372
|
+
/**
|
|
373
|
+
* What one verify may do with the registry. Required whenever a registry is configured.
|
|
374
|
+
*
|
|
375
|
+
* One field per Soft Binding Resolution API operation, and an absent one is not called.
|
|
376
|
+
* `matches/byBinding` is decided by the binders handed to the verify: each is derived and looked
|
|
377
|
+
* up, all together, and every result is kept. The content forms run after that, each for the
|
|
378
|
+
* detectors it names, hinted with the first fingerprint the binders derived. Results merge by
|
|
379
|
+
* manifest; nothing is ranked or dropped.
|
|
380
|
+
*/
|
|
381
|
+
interface Recovery {
|
|
382
|
+
/**
|
|
383
|
+
* When the registry is consulted at all.
|
|
384
|
+
*/
|
|
385
|
+
when: RecoveryPolicy;
|
|
386
|
+
/**
|
|
387
|
+
* `matches/byContent`: the bounded asset bytes travel in the request.
|
|
388
|
+
*/
|
|
389
|
+
byContent?: ByContent;
|
|
390
|
+
/**
|
|
391
|
+
* `matches/byReference`: the registry fetches the asset from the caller\'s URL instead, for
|
|
392
|
+
* an asset above the upload cap.
|
|
393
|
+
*/
|
|
394
|
+
byReference?: ByReference;
|
|
395
|
+
}
|
|
398
396
|
/**
|
|
399
397
|
* When [`AssetVerifier::verify_asset`] queries the registry.
|
|
400
398
|
*/
|
|
401
399
|
type RecoveryPolicy = "whenMissing" | "always";
|
|
402
400
|
/**
|
|
403
|
-
* Where the registry is
|
|
401
|
+
* Where the registry is. What a verify may do with it is per call, in [`Recovery`].
|
|
404
402
|
*/
|
|
405
403
|
interface RegistryOptions {
|
|
406
404
|
/**
|
|
@@ -408,14 +406,34 @@ interface RegistryOptions {
|
|
|
408
406
|
*/
|
|
409
407
|
url: string;
|
|
410
408
|
/**
|
|
411
|
-
*
|
|
409
|
+
* Federated resolution APIs a match may name as holding its manifest. C2PA 2.4 lets a
|
|
410
|
+
* match carry an `endpoint`; one listed here is fetched from, any other is reported as
|
|
411
|
+
* refused. Checked like `url`: https, or http on loopback only.
|
|
412
412
|
*/
|
|
413
|
-
|
|
413
|
+
endpoints?: string[];
|
|
414
414
|
}
|
|
415
415
|
/**
|
|
416
416
|
* Whether a code is a success, an informational note, or a failure.
|
|
417
417
|
*/
|
|
418
418
|
type ValidationCodeKind = "success" | "informational" | "failure";
|
|
419
|
+
/**
|
|
420
|
+
* Whether a content form runs on this verify. Judged against the byBinding results alone.
|
|
421
|
+
*/
|
|
422
|
+
type ContentTrigger = "byBindingMisses" | "always";
|
|
423
|
+
/**
|
|
424
|
+
* Which advertised server-side detectors a content form runs. Every selected detector runs,
|
|
425
|
+
* including one a local binder already queried by binding.
|
|
426
|
+
*/
|
|
427
|
+
type Detectors = {
|
|
428
|
+
kind: "fingerprint";
|
|
429
|
+
} | {
|
|
430
|
+
kind: "watermark";
|
|
431
|
+
} | {
|
|
432
|
+
kind: "all";
|
|
433
|
+
} | {
|
|
434
|
+
kind: "named";
|
|
435
|
+
algorithms: string[];
|
|
436
|
+
};
|
|
419
437
|
/**
|
|
420
438
|
* [`crate::asset::CredentialOrigin`] as JS sees it: a tagged union, since each way of finding a
|
|
421
439
|
* credential carries different evidence. Lane-local for the same reason [`FingerprintCheck`] is: a
|
|
@@ -449,6 +467,13 @@ type FingerprintCheck = {
|
|
|
449
467
|
* [`crate::asset::HardBinding`] as JS sees it.
|
|
450
468
|
*/
|
|
451
469
|
type HardBinding = "holds" | "mismatch";
|
|
470
|
+
/**
|
|
471
|
+
* [`crate::asset::Lineage`] as JS sees it.
|
|
472
|
+
*/
|
|
473
|
+
interface Lineage {
|
|
474
|
+
supersedes: string[];
|
|
475
|
+
supersededBy: string[];
|
|
476
|
+
}
|
|
452
477
|
interface AssetVerification {
|
|
453
478
|
credentials: FoundCredential[];
|
|
454
479
|
recovery: RecoverySummary;
|
|
@@ -487,14 +512,23 @@ type RecoveryDiscovery = {
|
|
|
487
512
|
binding: SoftBinding;
|
|
488
513
|
binderIndex: number;
|
|
489
514
|
registryScore: number | undefined;
|
|
515
|
+
endpoint: string | undefined;
|
|
490
516
|
} | {
|
|
491
517
|
method: "byContent";
|
|
492
518
|
hint: SoftBinding | undefined;
|
|
493
519
|
class: ContentBindingClass;
|
|
494
520
|
algorithm: string;
|
|
495
521
|
registryScore: number | undefined;
|
|
522
|
+
endpoint: string | undefined;
|
|
523
|
+
} | {
|
|
524
|
+
method: "byReference";
|
|
525
|
+
hint: SoftBinding | undefined;
|
|
526
|
+
class: ContentBindingClass;
|
|
527
|
+
algorithm: string;
|
|
528
|
+
registryScore: number | undefined;
|
|
529
|
+
endpoint: string | undefined;
|
|
496
530
|
};
|
|
497
|
-
type RecoveryIssueKind = "binder" | "bindingQuery" | "queryRefused" | "contentQuery" | "capabilities" | "contentTooLarge" | "candidateFetch" | "candidateValidation" | "resourceLimit";
|
|
531
|
+
type RecoveryIssueKind = "binder" | "bindingQuery" | "queryRefused" | "contentQuery" | "capabilities" | "contentTooLarge" | "candidateFetch" | "candidateValidation" | "resourceLimit" | "endpointRefused";
|
|
498
532
|
type RecoveryStatus = "notRequested" | "notFound" | "recovered" | "incomplete";
|
|
499
533
|
declare class AssetVerifier {
|
|
500
534
|
private constructor();
|
|
@@ -617,12 +651,12 @@ declare class StreamVerifier {
|
|
|
617
651
|
resume(stream_id: string, state: Uint8Array): StreamValidation;
|
|
618
652
|
}
|
|
619
653
|
/**
|
|
620
|
-
* Per-call soft-binding inputs.
|
|
654
|
+
* Per-call soft-binding inputs. `recovery` is required when the verifier has a registry.
|
|
621
655
|
*/
|
|
622
656
|
declare class VerifyOptions {
|
|
623
657
|
free(): void;
|
|
624
658
|
[Symbol.dispose](): void;
|
|
625
|
-
constructor(binders: Binder[],
|
|
659
|
+
constructor(binders: Binder[], recovery?: Recovery | null);
|
|
626
660
|
}
|
|
627
661
|
//#endregion
|
|
628
662
|
//#region src/worker-thread.d.ts
|
|
@@ -644,7 +678,8 @@ type BinderSpec = {
|
|
|
644
678
|
};
|
|
645
679
|
interface AssetVerifyOptions {
|
|
646
680
|
readonly binders?: readonly BinderSpec[];
|
|
647
|
-
|
|
681
|
+
/** Required when the verifier has a registry: what this verify may do with it. */
|
|
682
|
+
readonly recovery?: Recovery;
|
|
648
683
|
}
|
|
649
684
|
/**
|
|
650
685
|
* A wasm object held in this thread on the caller's behalf.
|