@blockcast/mmt-container 0.1.0-main.149f78a4adae
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 +432 -0
- package/dist/.build-stamp +0 -0
- package/dist/__tests__/test-utils.d.ts +71 -0
- package/dist/__tests__/test-utils.d.ts.map +1 -0
- package/dist/align.d.ts +148 -0
- package/dist/align.d.ts.map +1 -0
- package/dist/align.js +88 -0
- package/dist/align.js.map +7 -0
- package/dist/audio-init-parser.d.ts +66 -0
- package/dist/audio-init-parser.d.ts.map +1 -0
- package/dist/audio-init-parser.js +118 -0
- package/dist/audio-init-parser.js.map +7 -0
- package/dist/audio-ring-buffer.d.ts +50 -0
- package/dist/audio-ring-buffer.d.ts.map +1 -0
- package/dist/audio-ring-buffer.js +93 -0
- package/dist/audio-ring-buffer.js.map +7 -0
- package/dist/authored-timing.d.ts +32 -0
- package/dist/authored-timing.d.ts.map +1 -0
- package/dist/authored-timing.js +32 -0
- package/dist/authored-timing.js.map +7 -0
- package/dist/browser-runtime.js +17109 -0
- package/dist/browser-runtime.js.map +7 -0
- package/dist/carp-catalog.d.ts +318 -0
- package/dist/carp-catalog.d.ts.map +1 -0
- package/dist/carp-catalog.js +549 -0
- package/dist/carp-catalog.js.map +7 -0
- package/dist/catalog-fec-params.d.ts +82 -0
- package/dist/catalog-fec-params.d.ts.map +1 -0
- package/dist/catalog-fec-params.js +66 -0
- package/dist/catalog-fec-params.js.map +7 -0
- package/dist/catalog-network-source.d.ts +19 -0
- package/dist/catalog-network-source.d.ts.map +1 -0
- package/dist/catalog-network-source.js +22 -0
- package/dist/catalog-network-source.js.map +7 -0
- package/dist/catalog-validator.d.ts +18 -0
- package/dist/catalog-validator.d.ts.map +1 -0
- package/dist/catalog-validator.js +7747 -0
- package/dist/catalog-validator.js.map +7 -0
- package/dist/cmaf-block-assembler.d.ts +168 -0
- package/dist/cmaf-block-assembler.d.ts.map +1 -0
- package/dist/cmaf-block-assembler.js +1755 -0
- package/dist/cmaf-block-assembler.js.map +7 -0
- package/dist/cmaf-group-batcher.d.ts +38 -0
- package/dist/cmaf-group-batcher.d.ts.map +1 -0
- package/dist/cmaf-group-batcher.js +195 -0
- package/dist/cmaf-group-batcher.js.map +7 -0
- package/dist/cmcd-producer.d.ts +104 -0
- package/dist/cmcd-producer.d.ts.map +1 -0
- package/dist/cmcd-producer.js +207 -0
- package/dist/cmcd-producer.js.map +7 -0
- package/dist/codec-utils.d.ts +235 -0
- package/dist/codec-utils.d.ts.map +1 -0
- package/dist/codec-utils.js +1225 -0
- package/dist/codec-utils.js.map +7 -0
- package/dist/fec-codec.d.ts +32 -0
- package/dist/fec-codec.d.ts.map +1 -0
- package/dist/fec-codec.js +47 -0
- package/dist/fec-codec.js.map +7 -0
- package/dist/fec-manager.d.ts +266 -0
- package/dist/fec-manager.d.ts.map +1 -0
- package/dist/fec-manager.js +1447 -0
- package/dist/fec-manager.js.map +7 -0
- package/dist/fec-starvation-detector.d.ts +59 -0
- package/dist/fec-starvation-detector.d.ts.map +1 -0
- package/dist/fec-starvation-detector.js +75 -0
- package/dist/fec-starvation-detector.js.map +7 -0
- package/dist/fec-worker-setup.d.ts +76 -0
- package/dist/fec-worker-setup.d.ts.map +1 -0
- package/dist/fec-worker-setup.js +603 -0
- package/dist/fec-worker-setup.js.map +7 -0
- package/dist/fmp4-completion.d.ts +30 -0
- package/dist/fmp4-completion.d.ts.map +1 -0
- package/dist/fmp4-completion.js +21 -0
- package/dist/fmp4-completion.js.map +7 -0
- package/dist/fmp4-reader.d.ts +37 -0
- package/dist/fmp4-reader.d.ts.map +1 -0
- package/dist/fmp4-reader.js +100 -0
- package/dist/fmp4-reader.js.map +7 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +330 -0
- package/dist/index.js.map +7 -0
- package/dist/iso-bmff-timing.d.ts +47 -0
- package/dist/iso-bmff-timing.d.ts.map +1 -0
- package/dist/iso-bmff-timing.js +526 -0
- package/dist/iso-bmff-timing.js.map +7 -0
- package/dist/loc.d.ts +68 -0
- package/dist/loc.d.ts.map +1 -0
- package/dist/loc.js +143 -0
- package/dist/loc.js.map +7 -0
- package/dist/manifest-auth-plan.d.ts +30 -0
- package/dist/manifest-auth-plan.d.ts.map +1 -0
- package/dist/manifest-auth-plan.js +1267 -0
- package/dist/manifest-auth-plan.js.map +7 -0
- package/dist/media-router.d.ts +338 -0
- package/dist/media-router.d.ts.map +1 -0
- package/dist/media-router.js +802 -0
- package/dist/media-router.js.map +7 -0
- package/dist/mfu-reassembler.d.ts +264 -0
- package/dist/mfu-reassembler.d.ts.map +1 -0
- package/dist/mfu-reassembler.js +2668 -0
- package/dist/mfu-reassembler.js.map +7 -0
- package/dist/mfu-reassembly-policy.d.ts +24 -0
- package/dist/mfu-reassembly-policy.d.ts.map +1 -0
- package/dist/mfu-reassembly-policy.js +99 -0
- package/dist/mfu-reassembly-policy.js.map +7 -0
- package/dist/mmtp-container-parser.d.ts +304 -0
- package/dist/mmtp-container-parser.d.ts.map +1 -0
- package/dist/mmtp-container-parser.js +5378 -0
- package/dist/mmtp-container-parser.js.map +7 -0
- package/dist/mmtp-container-parser.no-modules.js +7853 -0
- package/dist/mmtp-container-parser.no-modules.js.map +7 -0
- package/dist/mmtp-decode-pipeline.d.ts +96 -0
- package/dist/mmtp-decode-pipeline.d.ts.map +1 -0
- package/dist/mmtp-decode-pipeline.js +5589 -0
- package/dist/mmtp-decode-pipeline.js.map +7 -0
- package/dist/mmtp-router.d.ts +383 -0
- package/dist/mmtp-router.d.ts.map +1 -0
- package/dist/mmtp-router.js +8384 -0
- package/dist/mmtp-router.js.map +7 -0
- package/dist/mmtp-to-cmaf.d.ts +166 -0
- package/dist/mmtp-to-cmaf.d.ts.map +1 -0
- package/dist/mmtp-to-cmaf.js +781 -0
- package/dist/mmtp-to-cmaf.js.map +7 -0
- package/dist/multicast-auth-catalog.d.ts +115 -0
- package/dist/multicast-auth-catalog.d.ts.map +1 -0
- package/dist/multicast-auth-catalog.js +202 -0
- package/dist/multicast-auth-catalog.js.map +7 -0
- package/dist/multicast-input.d.ts +107 -0
- package/dist/multicast-input.d.ts.map +1 -0
- package/dist/multicast-input.js +256 -0
- package/dist/multicast-input.js.map +7 -0
- package/dist/multicast-manager.d.ts +330 -0
- package/dist/multicast-manager.d.ts.map +1 -0
- package/dist/multicast-manager.js +11032 -0
- package/dist/multicast-manager.js.map +7 -0
- package/dist/multicast-transport.d.ts +62 -0
- package/dist/multicast-transport.d.ts.map +1 -0
- package/dist/multicast-transport.js +338 -0
- package/dist/multicast-transport.js.map +7 -0
- package/dist/multicast-unwrap.d.ts +57 -0
- package/dist/multicast-unwrap.d.ts.map +1 -0
- package/dist/multicast-unwrap.js +384 -0
- package/dist/multicast-unwrap.js.map +7 -0
- package/dist/no-modules.d.ts +9 -0
- package/dist/no-modules.d.ts.map +1 -0
- package/dist/no-modules.js +7819 -0
- package/dist/no-modules.js.map +7 -0
- package/dist/phase14-catalog-override.d.ts +126 -0
- package/dist/phase14-catalog-override.d.ts.map +1 -0
- package/dist/phase14-catalog-override.js +155 -0
- package/dist/phase14-catalog-override.js.map +7 -0
- package/dist/repair-fetch.d.ts +58 -0
- package/dist/repair-fetch.d.ts.map +1 -0
- package/dist/repair-fetch.js +117 -0
- package/dist/repair-fetch.js.map +7 -0
- package/dist/sample-combiner.d.ts +182 -0
- package/dist/sample-combiner.d.ts.map +1 -0
- package/dist/sample-combiner.js +571 -0
- package/dist/sample-combiner.js.map +7 -0
- package/dist/signaling.d.ts +29 -0
- package/dist/signaling.d.ts.map +1 -0
- package/dist/signaling.js +232 -0
- package/dist/signaling.js.map +7 -0
- package/dist/source-auth.d.ts +2 -0
- package/dist/source-auth.d.ts.map +1 -0
- package/dist/source-auth.js +1220 -0
- package/dist/source-auth.js.map +7 -0
- package/dist/switching-set-alignment.d.ts +61 -0
- package/dist/switching-set-alignment.d.ts.map +1 -0
- package/dist/switching-set-alignment.js +85 -0
- package/dist/switching-set-alignment.js.map +7 -0
- package/dist/timestamp-codec.d.ts +34 -0
- package/dist/timestamp-codec.d.ts.map +1 -0
- package/dist/timestamp-codec.js +456 -0
- package/dist/timestamp-codec.js.map +7 -0
- package/dist/track-pipeline-setup.d.ts +72 -0
- package/dist/track-pipeline-setup.d.ts.map +1 -0
- package/dist/track-pipeline-setup.js +306 -0
- package/dist/track-pipeline-setup.js.map +7 -0
- package/dist/track-pipeline.d.ts +121 -0
- package/dist/track-pipeline.d.ts.map +1 -0
- package/dist/track-pipeline.js +229 -0
- package/dist/track-pipeline.js.map +7 -0
- package/dist/track-session.d.ts +269 -0
- package/dist/track-session.d.ts.map +1 -0
- package/dist/track-session.js +597 -0
- package/dist/track-session.js.map +7 -0
- package/dist/transport-pool.d.ts +69 -0
- package/dist/transport-pool.d.ts.map +1 -0
- package/dist/transport-pool.js +88 -0
- package/dist/transport-pool.js.map +7 -0
- package/dist/wasm-mfu-reassembler.d.ts +81 -0
- package/dist/wasm-mfu-reassembler.d.ts.map +1 -0
- package/dist/wasm-mfu-reassembler.js +1915 -0
- package/dist/wasm-mfu-reassembler.js.map +7 -0
- package/dist/wasm-mmtp-container-parser.d.ts +10 -0
- package/dist/wasm-mmtp-container-parser.d.ts.map +1 -0
- package/dist/wasm-mmtp-container-parser.js +5635 -0
- package/dist/wasm-mmtp-container-parser.js.map +7 -0
- package/node_modules/@blockcast/fec-worker/README.md +213 -0
- package/node_modules/@blockcast/fec-worker/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +80 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +270 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +252 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js +11 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts +14 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +565 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +7 -0
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts +10 -0
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/index.js +8 -0
- package/node_modules/@blockcast/fec-worker/dist/index.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts +20 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js +349 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js.map +7 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts +104 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js +181 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts +179 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js +47 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts +9 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.js +13 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/package.json +59 -0
- package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +309 -0
- package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +268 -0
- package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +1048 -0
- package/node_modules/@blockcast/fec-worker/src/index.ts +32 -0
- package/node_modules/@blockcast/fec-worker/src/shred-fec-worker.ts +558 -0
- package/node_modules/@blockcast/fec-worker/src/shred-worker-client.ts +222 -0
- package/node_modules/@blockcast/fec-worker/src/shred-worker-types.ts +194 -0
- package/node_modules/@blockcast/fec-worker/src/transfer.ts +12 -0
- package/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
- package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
- package/node_modules/@blockcast/mmt-base/README.md +120 -0
- package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts +2 -0
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/index.js +2 -0
- package/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +275 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js +644 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/package.json +49 -0
- package/node_modules/@blockcast/mmt-base/src/index.ts +1 -0
- package/node_modules/@blockcast/mmt-base/src/mmtp.ts +898 -0
- package/node_modules/@blockcast/mmt-fec/README.md +270 -0
- package/node_modules/@blockcast/mmt-fec/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts +80 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js +294 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +72 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +192 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts +46 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js +96 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts +33 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js +57 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +185 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +273 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +22 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.js +22 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts +20 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js +28 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts +174 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.js +256 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts +41 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js +81 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +120 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts +2 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js +2 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +275 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +644 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/package.json +49 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/index.ts +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +898 -0
- package/node_modules/@blockcast/mmt-fec/package.json +79 -0
- package/node_modules/@blockcast/mmt-fec/src/block-manager.ts +369 -0
- package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +277 -0
- package/node_modules/@blockcast/mmt-fec/src/cmaf-recovery.ts +127 -0
- package/node_modules/@blockcast/mmt-fec/src/cmaf-symbols.ts +68 -0
- package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +332 -0
- package/node_modules/@blockcast/mmt-fec/src/index.ts +77 -0
- package/node_modules/@blockcast/mmt-fec/src/loc-symbols.ts +34 -0
- package/node_modules/@blockcast/mmt-fec/src/oti.ts +319 -0
- package/node_modules/@blockcast/mmt-fec/src/reorder-buffer.ts +101 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts +28 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js +128 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts +4 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js +4 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts +37 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js +179 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts +90 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js +462 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/package.json +45 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/admission.ts +171 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/index.ts +3 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/source-auth.ts +230 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/verifier.ts +636 -0
- package/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/@noble/hashes/README.md +521 -0
- package/node_modules/@noble/hashes/_assert.d.ts +17 -0
- package/node_modules/@noble/hashes/_assert.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_assert.js +18 -0
- package/node_modules/@noble/hashes/_assert.js.map +1 -0
- package/node_modules/@noble/hashes/_blake.d.ts +14 -0
- package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_blake.js +50 -0
- package/node_modules/@noble/hashes/_blake.js.map +1 -0
- package/node_modules/@noble/hashes/_md.d.ts +51 -0
- package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_md.js +162 -0
- package/node_modules/@noble/hashes/_md.js.map +1 -0
- package/node_modules/@noble/hashes/_u64.d.ts +55 -0
- package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_u64.js +90 -0
- package/node_modules/@noble/hashes/_u64.js.map +1 -0
- package/node_modules/@noble/hashes/argon2.d.ts +32 -0
- package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/argon2.js +401 -0
- package/node_modules/@noble/hashes/argon2.js.map +1 -0
- package/node_modules/@noble/hashes/blake1.d.ts +106 -0
- package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake1.js +459 -0
- package/node_modules/@noble/hashes/blake1.js.map +1 -0
- package/node_modules/@noble/hashes/blake2.d.ts +116 -0
- package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2.js +420 -0
- package/node_modules/@noble/hashes/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/blake2b.d.ts +11 -0
- package/node_modules/@noble/hashes/blake2b.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2b.js +14 -0
- package/node_modules/@noble/hashes/blake2b.js.map +1 -0
- package/node_modules/@noble/hashes/blake2s.d.ts +20 -0
- package/node_modules/@noble/hashes/blake2s.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2s.js +24 -0
- package/node_modules/@noble/hashes/blake2s.js.map +1 -0
- package/node_modules/@noble/hashes/blake3.d.ts +54 -0
- package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake3.js +255 -0
- package/node_modules/@noble/hashes/blake3.js.map +1 -0
- package/node_modules/@noble/hashes/crypto.d.ts +2 -0
- package/node_modules/@noble/hashes/crypto.d.ts.map +1 -0
- package/node_modules/@noble/hashes/crypto.js +5 -0
- package/node_modules/@noble/hashes/crypto.js.map +1 -0
- package/node_modules/@noble/hashes/cryptoNode.d.ts +2 -0
- package/node_modules/@noble/hashes/cryptoNode.d.ts.map +1 -0
- package/node_modules/@noble/hashes/cryptoNode.js +18 -0
- package/node_modules/@noble/hashes/cryptoNode.js.map +1 -0
- package/node_modules/@noble/hashes/eskdf.d.ts +47 -0
- package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/eskdf.js +166 -0
- package/node_modules/@noble/hashes/eskdf.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_assert.d.ts +17 -0
- package/node_modules/@noble/hashes/esm/_assert.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_assert.js +15 -0
- package/node_modules/@noble/hashes/esm/_assert.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_blake.d.ts +14 -0
- package/node_modules/@noble/hashes/esm/_blake.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_blake.js +45 -0
- package/node_modules/@noble/hashes/esm/_blake.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_md.d.ts +51 -0
- package/node_modules/@noble/hashes/esm/_md.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_md.js +155 -0
- package/node_modules/@noble/hashes/esm/_md.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_u64.d.ts +55 -0
- package/node_modules/@noble/hashes/esm/_u64.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_u64.js +67 -0
- package/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
- package/node_modules/@noble/hashes/esm/argon2.d.ts +32 -0
- package/node_modules/@noble/hashes/esm/argon2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/argon2.js +392 -0
- package/node_modules/@noble/hashes/esm/argon2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake1.d.ts +106 -0
- package/node_modules/@noble/hashes/esm/blake1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake1.js +452 -0
- package/node_modules/@noble/hashes/esm/blake1.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2.d.ts +116 -0
- package/node_modules/@noble/hashes/esm/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2.js +413 -0
- package/node_modules/@noble/hashes/esm/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2b.d.ts +11 -0
- package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2b.js +11 -0
- package/node_modules/@noble/hashes/esm/blake2b.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2s.d.ts +20 -0
- package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2s.js +21 -0
- package/node_modules/@noble/hashes/esm/blake2s.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake3.d.ts +54 -0
- package/node_modules/@noble/hashes/esm/blake3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake3.js +251 -0
- package/node_modules/@noble/hashes/esm/blake3.js.map +1 -0
- package/node_modules/@noble/hashes/esm/crypto.d.ts +2 -0
- package/node_modules/@noble/hashes/esm/crypto.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/crypto.js +2 -0
- package/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +2 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.js +15 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.js.map +1 -0
- package/node_modules/@noble/hashes/esm/eskdf.d.ts +47 -0
- package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/eskdf.js +160 -0
- package/node_modules/@noble/hashes/esm/eskdf.js.map +1 -0
- package/node_modules/@noble/hashes/esm/hkdf.d.ts +36 -0
- package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/hkdf.js +82 -0
- package/node_modules/@noble/hashes/esm/hkdf.js.map +1 -0
- package/node_modules/@noble/hashes/esm/hmac.d.ts +35 -0
- package/node_modules/@noble/hashes/esm/hmac.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/hmac.js +86 -0
- package/node_modules/@noble/hashes/esm/hmac.js.map +1 -0
- package/node_modules/@noble/hashes/esm/index.d.ts +2 -0
- package/node_modules/@noble/hashes/esm/index.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/index.js +33 -0
- package/node_modules/@noble/hashes/esm/index.js.map +1 -0
- package/node_modules/@noble/hashes/esm/legacy.d.ts +71 -0
- package/node_modules/@noble/hashes/esm/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/legacy.js +281 -0
- package/node_modules/@noble/hashes/esm/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/esm/package.json +10 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +23 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.js +97 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts +13 -0
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/ripemd160.js +13 -0
- package/node_modules/@noble/hashes/esm/ripemd160.js.map +1 -0
- package/node_modules/@noble/hashes/esm/scrypt.d.ts +34 -0
- package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/scrypt.js +228 -0
- package/node_modules/@noble/hashes/esm/scrypt.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha1.d.ts +11 -0
- package/node_modules/@noble/hashes/esm/sha1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha1.js +11 -0
- package/node_modules/@noble/hashes/esm/sha1.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha2.d.ts +159 -0
- package/node_modules/@noble/hashes/esm/sha2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha2.js +375 -0
- package/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha256.d.ts +20 -0
- package/node_modules/@noble/hashes/esm/sha256.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha256.js +20 -0
- package/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +142 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.js +393 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3.d.ts +53 -0
- package/node_modules/@noble/hashes/esm/sha3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3.js +234 -0
- package/node_modules/@noble/hashes/esm/sha3.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha512.d.ts +26 -0
- package/node_modules/@noble/hashes/esm/sha512.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha512.js +26 -0
- package/node_modules/@noble/hashes/esm/sha512.js.map +1 -0
- package/node_modules/@noble/hashes/esm/utils.d.ts +161 -0
- package/node_modules/@noble/hashes/esm/utils.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/utils.js +281 -0
- package/node_modules/@noble/hashes/esm/utils.js.map +1 -0
- package/node_modules/@noble/hashes/hkdf.d.ts +36 -0
- package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hkdf.js +88 -0
- package/node_modules/@noble/hashes/hkdf.js.map +1 -0
- package/node_modules/@noble/hashes/hmac.d.ts +35 -0
- package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hmac.js +91 -0
- package/node_modules/@noble/hashes/hmac.js.map +1 -0
- package/node_modules/@noble/hashes/index.d.ts +1 -0
- package/node_modules/@noble/hashes/index.d.ts.map +1 -0
- package/node_modules/@noble/hashes/index.js +33 -0
- package/node_modules/@noble/hashes/index.js.map +1 -0
- package/node_modules/@noble/hashes/legacy.d.ts +71 -0
- package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/legacy.js +287 -0
- package/node_modules/@noble/hashes/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/package.json +266 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts +23 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/pbkdf2.js +101 -0
- package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
- package/node_modules/@noble/hashes/ripemd160.d.ts +13 -0
- package/node_modules/@noble/hashes/ripemd160.d.ts.map +1 -0
- package/node_modules/@noble/hashes/ripemd160.js +16 -0
- package/node_modules/@noble/hashes/ripemd160.js.map +1 -0
- package/node_modules/@noble/hashes/scrypt.d.ts +34 -0
- package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
- package/node_modules/@noble/hashes/scrypt.js +232 -0
- package/node_modules/@noble/hashes/scrypt.js.map +1 -0
- package/node_modules/@noble/hashes/sha1.d.ts +11 -0
- package/node_modules/@noble/hashes/sha1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha1.js +14 -0
- package/node_modules/@noble/hashes/sha1.js.map +1 -0
- package/node_modules/@noble/hashes/sha2.d.ts +159 -0
- package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha2.js +384 -0
- package/node_modules/@noble/hashes/sha2.js.map +1 -0
- package/node_modules/@noble/hashes/sha256.d.ts +20 -0
- package/node_modules/@noble/hashes/sha256.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha256.js +23 -0
- package/node_modules/@noble/hashes/sha256.js.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts +142 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.js +402 -0
- package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
- package/node_modules/@noble/hashes/sha3.d.ts +53 -0
- package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3.js +239 -0
- package/node_modules/@noble/hashes/sha3.js.map +1 -0
- package/node_modules/@noble/hashes/sha512.d.ts +26 -0
- package/node_modules/@noble/hashes/sha512.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha512.js +29 -0
- package/node_modules/@noble/hashes/sha512.js.map +1 -0
- package/node_modules/@noble/hashes/src/_assert.ts +22 -0
- package/node_modules/@noble/hashes/src/_blake.ts +50 -0
- package/node_modules/@noble/hashes/src/_md.ts +176 -0
- package/node_modules/@noble/hashes/src/_u64.ts +91 -0
- package/node_modules/@noble/hashes/src/argon2.ts +497 -0
- package/node_modules/@noble/hashes/src/blake1.ts +534 -0
- package/node_modules/@noble/hashes/src/blake2.ts +486 -0
- package/node_modules/@noble/hashes/src/blake2b.ts +10 -0
- package/node_modules/@noble/hashes/src/blake2s.ts +20 -0
- package/node_modules/@noble/hashes/src/blake3.ts +272 -0
- package/node_modules/@noble/hashes/src/crypto.ts +9 -0
- package/node_modules/@noble/hashes/src/cryptoNode.ts +15 -0
- package/node_modules/@noble/hashes/src/eskdf.ts +187 -0
- package/node_modules/@noble/hashes/src/hkdf.ts +88 -0
- package/node_modules/@noble/hashes/src/hmac.ts +94 -0
- package/node_modules/@noble/hashes/src/index.ts +31 -0
- package/node_modules/@noble/hashes/src/legacy.ts +293 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +122 -0
- package/node_modules/@noble/hashes/src/ripemd160.ts +12 -0
- package/node_modules/@noble/hashes/src/scrypt.ts +257 -0
- package/node_modules/@noble/hashes/src/sha1.ts +10 -0
- package/node_modules/@noble/hashes/src/sha2.ts +402 -0
- package/node_modules/@noble/hashes/src/sha256.ts +24 -0
- package/node_modules/@noble/hashes/src/sha3-addons.ts +499 -0
- package/node_modules/@noble/hashes/src/sha3.ts +258 -0
- package/node_modules/@noble/hashes/src/sha512.ts +34 -0
- package/node_modules/@noble/hashes/src/utils.ts +395 -0
- package/node_modules/@noble/hashes/utils.d.ts +161 -0
- package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
- package/node_modules/@noble/hashes/utils.js +313 -0
- package/node_modules/@noble/hashes/utils.js.map +1 -0
- package/package.json +203 -0
- package/schemas/catalog.schema.json +283 -0
- package/src/align.ts +235 -0
- package/src/audio-init-parser.ts +189 -0
- package/src/audio-ring-buffer.ts +120 -0
- package/src/authored-timing.ts +63 -0
- package/src/carp-catalog.ts +776 -0
- package/src/catalog-fec-params.ts +167 -0
- package/src/catalog-network-source.ts +49 -0
- package/src/catalog-validator.ts +34 -0
- package/src/cmaf-block-assembler.ts +1058 -0
- package/src/cmaf-group-batcher.ts +104 -0
- package/src/cmcd-producer.ts +329 -0
- package/src/codec-utils.ts +1539 -0
- package/src/fec-codec.ts +61 -0
- package/src/fec-manager.ts +1939 -0
- package/src/fec-starvation-detector.ts +128 -0
- package/src/fec-worker-setup.ts +177 -0
- package/src/fmp4-completion.ts +47 -0
- package/src/fmp4-reader.ts +112 -0
- package/src/index.ts +443 -0
- package/src/iso-bmff-timing.ts +688 -0
- package/src/loc.ts +181 -0
- package/src/manifest-auth-plan.ts +107 -0
- package/src/media-router.ts +1185 -0
- package/src/mfu-reassembler.ts +2842 -0
- package/src/mfu-reassembly-policy.ts +134 -0
- package/src/mmtp-container-parser.ts +1498 -0
- package/src/mmtp-decode-pipeline.ts +315 -0
- package/src/mmtp-router.ts +3027 -0
- package/src/mmtp-to-cmaf.ts +956 -0
- package/src/multicast-auth-catalog.ts +340 -0
- package/src/multicast-input.ts +439 -0
- package/src/multicast-manager.ts +1503 -0
- package/src/multicast-transport.ts +320 -0
- package/src/multicast-unwrap.ts +132 -0
- package/src/no-modules.ts +20 -0
- package/src/phase14-catalog-override.ts +336 -0
- package/src/repair-fetch.ts +217 -0
- package/src/sample-combiner.ts +846 -0
- package/src/signaling.ts +78 -0
- package/src/source-auth.ts +1 -0
- package/src/switching-set-alignment.ts +109 -0
- package/src/timestamp-codec.ts +265 -0
- package/src/track-pipeline-setup.ts +189 -0
- package/src/track-pipeline.ts +332 -0
- package/src/track-session.ts +778 -0
- package/src/transport-pool.ts +128 -0
- package/src/wasm-mfu-reassembler.ts +372 -0
- package/src/wasm-mmtp-container-parser.ts +23 -0
- package/test-vectors/align.json +199 -0
- package/test-vectors/catalog/README.md +25 -0
- package/test-vectors/catalog/negative/legacy-selection-params.json +15 -0
- package/test-vectors/catalog/negative/missing-mmtp-fields.json +12 -0
- package/test-vectors/catalog/negative/multicast-auth-padded-key.json +37 -0
- package/test-vectors/catalog/negative/multicast-auth-reused-track-format.json +53 -0
- package/test-vectors/catalog/negative/multicast-auth-trailing-pad-bits.json +37 -0
- package/test-vectors/catalog/negative/multicast-endpoint-missing-protocol-and-source.json +24 -0
- package/test-vectors/catalog/negative/network-source-object.json +25 -0
- package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +26 -0
- package/test-vectors/catalog/negative/repair-track-legacy-shape.json +18 -0
- package/test-vectors/catalog/negative/track-role-empty.json +16 -0
- package/test-vectors/catalog/negative/track-role-non-string.json +16 -0
- package/test-vectors/catalog/positive/fec-multicast.json +51 -0
- package/test-vectors/catalog/positive/flat-av.json +30 -0
- package/test-vectors/catalog/positive/multicast-auth-rotation.json +55 -0
- package/test-vectors/catalog/positive/ticks-and-mixed-timescales.json +39 -0
- package/test-vectors/catalog/positive/track-role.json +49 -0
- package/test-vectors/catalog/releases/moqcast-native-v16-v1/catalog.json +65 -0
- package/test-vectors/catalog/releases/moqcast-native-v16-v1.archive.sha256 +1 -0
- package/test-vectors/catalog-multicast-auth-v1.json +26 -0
- package/test-vectors/catalog-validation.json +148 -0
- package/test-vectors/catalog-validator-public-api.mjs +25 -0
- package/test-vectors/generate-source-auth-fixture.mjs +114 -0
- package/test-vectors/source-auth-v1.json +61 -0
- package/test-vectors/subsample-placement-v1.json +230 -0
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeSourceAuthManifestFrame,
|
|
3
|
+
sourceAuthMerkleRoot,
|
|
4
|
+
sourceAuthObjectDigest,
|
|
5
|
+
sourceAuthSignaturePreimage,
|
|
6
|
+
type SourceAuthGroupClose,
|
|
7
|
+
type SourceAuthObjectEntry,
|
|
8
|
+
} from './source-auth.js'
|
|
9
|
+
|
|
10
|
+
export type ManifestAuthMode = 'off' | 'shadow' | 'enforce'
|
|
11
|
+
export type MissingManifestPolicy = 'stall' | 'fallback-shadow'
|
|
12
|
+
export type ManifestFailureReason =
|
|
13
|
+
| 'sigInvalid'
|
|
14
|
+
| 'digestMismatch'
|
|
15
|
+
| 'manifestLate'
|
|
16
|
+
| 'manifestAbsent'
|
|
17
|
+
| 'verifierError'
|
|
18
|
+
|
|
19
|
+
export interface ManifestAuthConfig {
|
|
20
|
+
mode: ManifestAuthMode
|
|
21
|
+
onMissingManifest: MissingManifestPolicy
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ManifestObjectIdentity {
|
|
25
|
+
trackName: string
|
|
26
|
+
/** Stable v2 auth binding. Defaults to trackName for legacy single-format callers. */
|
|
27
|
+
bindingId?: string
|
|
28
|
+
/** MoQ group ids are u62; values above 2^53 must be passed as bigint. */
|
|
29
|
+
groupId: number | bigint
|
|
30
|
+
objectId: number
|
|
31
|
+
packetId?: number
|
|
32
|
+
ssId?: number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ManifestFecBlockMapper {
|
|
36
|
+
readonly d: number
|
|
37
|
+
derive(groupId: number, objectId: number): { ssId: number }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ManifestTrackContext {
|
|
41
|
+
broadcastNamespaceId: string
|
|
42
|
+
trackName: string
|
|
43
|
+
/** Stable v2 auth binding. Defaults to trackName for legacy single-format callers. */
|
|
44
|
+
bindingId?: string
|
|
45
|
+
sourceSymbolFormat?: string
|
|
46
|
+
keyEpoch: number
|
|
47
|
+
codec: string
|
|
48
|
+
timing: string
|
|
49
|
+
fecGeometry: string
|
|
50
|
+
manifestFormatVersion: number
|
|
51
|
+
/** Authenticated-catalog binding for the namespace, track, epoch, codec,
|
|
52
|
+
* timing, FEC geometry, and manifest version fields above. */
|
|
53
|
+
authScope: Uint8Array
|
|
54
|
+
publicKey: Uint8Array
|
|
55
|
+
/** Current key first, followed by any catalog-advertised overlap keys. */
|
|
56
|
+
acceptedPublicKeys?: readonly Uint8Array[]
|
|
57
|
+
bitrate: number
|
|
58
|
+
groupDurationMs: number
|
|
59
|
+
mapper: ManifestFecBlockMapper
|
|
60
|
+
manifestChannelAuthenticated: boolean
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ManifestVerificationStats {
|
|
64
|
+
verified: number
|
|
65
|
+
/** Terminal outcomes only: an object counted here will never be verified. */
|
|
66
|
+
failures: Record<ManifestFailureReason, number>
|
|
67
|
+
/**
|
|
68
|
+
* Objects currently held in quarantine awaiting a manifest — pending, NOT
|
|
69
|
+
* failed, and deliberately disjoint from `failures`. An enforce-mode stall is
|
|
70
|
+
* accounted here first and moves into `failures` only once the verifier gives
|
|
71
|
+
* up on it, so a reason breakdown that ignores this gauge under-reports live
|
|
72
|
+
* stalls by whatever is still in flight (BLO-30007).
|
|
73
|
+
*/
|
|
74
|
+
quarantined: number
|
|
75
|
+
quarantinedBytes: number
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ManifestFailure {
|
|
79
|
+
trackName: string
|
|
80
|
+
bindingId?: string
|
|
81
|
+
groupId: number | bigint
|
|
82
|
+
objectId: number
|
|
83
|
+
reason: ManifestFailureReason
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ManifestAdmission {
|
|
87
|
+
action: 'play' | 'stall' | 'drop'
|
|
88
|
+
verified: boolean
|
|
89
|
+
reason?: ManifestFailureReason
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type SignatureVerifier = (
|
|
93
|
+
publicKey: Uint8Array,
|
|
94
|
+
message: Uint8Array,
|
|
95
|
+
signature: Uint8Array,
|
|
96
|
+
) => boolean | Promise<boolean>
|
|
97
|
+
|
|
98
|
+
export function manifestBindingId(trackName: string, sourceSymbolFormat: string): string {
|
|
99
|
+
return JSON.stringify([trackName, sourceSymbolFormat])
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function createWebCryptoEd25519Verifier(
|
|
103
|
+
subtle: SubtleCrypto = globalThis.crypto.subtle,
|
|
104
|
+
): SignatureVerifier {
|
|
105
|
+
return async (publicKey, message, signature) => {
|
|
106
|
+
const keyBytes = Uint8Array.from(publicKey)
|
|
107
|
+
const messageBytes = Uint8Array.from(message)
|
|
108
|
+
const signatureBytes = Uint8Array.from(signature)
|
|
109
|
+
const key = await subtle.importKey('raw', keyBytes.buffer, 'Ed25519', false, ['verify'])
|
|
110
|
+
return subtle.verify('Ed25519', key, signatureBytes.buffer, messageBytes.buffer)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface PendingObject {
|
|
115
|
+
identity: ManifestObjectIdentity
|
|
116
|
+
data: Uint8Array
|
|
117
|
+
release: () => void
|
|
118
|
+
bytes: number
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface GroupState {
|
|
122
|
+
entries: Map<number, SourceAuthObjectEntry>
|
|
123
|
+
pending: Map<number, PendingObject>
|
|
124
|
+
close?: SourceAuthGroupClose
|
|
125
|
+
/** Close frame that arrived before all object entries (manifest-channel
|
|
126
|
+
* reordering); retried once the entry count matches. */
|
|
127
|
+
pendingClose?: SourceAuthGroupClose
|
|
128
|
+
rootVerified: boolean
|
|
129
|
+
signaturePending?: boolean
|
|
130
|
+
failed?: ManifestFailureReason
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface TrackState {
|
|
134
|
+
context: ManifestTrackContext
|
|
135
|
+
groups: Map<bigint, GroupState>
|
|
136
|
+
quarantine: PendingObject[]
|
|
137
|
+
quarantinedBytes: number
|
|
138
|
+
capBytes: number
|
|
139
|
+
manifestEntries: number
|
|
140
|
+
maxManifestEntries: number
|
|
141
|
+
maxGroups: number
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const FAILURE_REASONS: readonly ManifestFailureReason[] = [
|
|
145
|
+
'sigInvalid',
|
|
146
|
+
'digestMismatch',
|
|
147
|
+
'manifestLate',
|
|
148
|
+
'manifestAbsent',
|
|
149
|
+
'verifierError',
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
const equalBytes = (left: Uint8Array, right: Uint8Array): boolean => {
|
|
153
|
+
if (left.byteLength !== right.byteLength) return false
|
|
154
|
+
let diff = 0
|
|
155
|
+
for (let index = 0; index < left.byteLength; index++) diff |= left[index]! ^ right[index]!
|
|
156
|
+
return diff === 0
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const isPromiseLike = (value: boolean | Promise<boolean>): value is Promise<boolean> =>
|
|
160
|
+
typeof value === 'object' && value !== null && typeof value.then === 'function'
|
|
161
|
+
|
|
162
|
+
export class ManifestVerifier {
|
|
163
|
+
#config: ManifestAuthConfig
|
|
164
|
+
readonly #verifySignature: SignatureVerifier
|
|
165
|
+
readonly #onFailure?: (failure: ManifestFailure) => void
|
|
166
|
+
readonly #tracks = new Map<string, TrackState>()
|
|
167
|
+
readonly #stats: Omit<ManifestVerificationStats, 'quarantined'> = {
|
|
168
|
+
verified: 0,
|
|
169
|
+
failures: Object.fromEntries(FAILURE_REASONS.map((reason) => [reason, 0])) as Record<ManifestFailureReason, number>,
|
|
170
|
+
quarantinedBytes: 0,
|
|
171
|
+
}
|
|
172
|
+
#disposed = false
|
|
173
|
+
|
|
174
|
+
constructor(options: {
|
|
175
|
+
manifestAuth: ManifestAuthConfig
|
|
176
|
+
verifySignature: SignatureVerifier
|
|
177
|
+
onFailure?: (failure: ManifestFailure) => void
|
|
178
|
+
}) {
|
|
179
|
+
this.#config = { ...options.manifestAuth }
|
|
180
|
+
this.#verifySignature = options.verifySignature
|
|
181
|
+
this.#onFailure = options.onFailure
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
get config(): Readonly<ManifestAuthConfig> {
|
|
185
|
+
return this.#config
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
get stats(): ManifestVerificationStats {
|
|
189
|
+
let quarantined = 0
|
|
190
|
+
for (const track of this.#tracks.values()) quarantined += track.quarantine.length
|
|
191
|
+
return {
|
|
192
|
+
verified: this.#stats.verified,
|
|
193
|
+
failures: { ...this.#stats.failures },
|
|
194
|
+
quarantined,
|
|
195
|
+
quarantinedBytes: this.#stats.quarantinedBytes,
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
setMode(mode: ManifestAuthMode): void {
|
|
200
|
+
this.#config = { ...this.#config, mode }
|
|
201
|
+
if (mode !== 'enforce') this.#releaseAllQuarantine(false)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
registerTrack(context: ManifestTrackContext): void {
|
|
205
|
+
const bindingId = context.bindingId ?? context.trackName
|
|
206
|
+
if (this.#tracks.has(bindingId)) {
|
|
207
|
+
throw new Error(`manifest binding ${bindingId} is already registered`)
|
|
208
|
+
}
|
|
209
|
+
if (!Number.isFinite(context.bitrate) || context.bitrate <= 0) {
|
|
210
|
+
throw new Error('manifest track bitrate must be > 0')
|
|
211
|
+
}
|
|
212
|
+
if (!Number.isFinite(context.groupDurationMs) || context.groupDurationMs <= 0) {
|
|
213
|
+
throw new Error('manifest track groupDurationMs must be > 0')
|
|
214
|
+
}
|
|
215
|
+
if (context.authScope.byteLength !== 32) throw new Error('manifest authScope must be 32 bytes')
|
|
216
|
+
if (context.publicKey.byteLength !== 32) throw new Error('manifest publicKey must be 32 bytes')
|
|
217
|
+
for (const key of context.acceptedPublicKeys ?? []) {
|
|
218
|
+
if (key.byteLength !== 32) throw new Error('manifest acceptedPublicKeys must contain 32-byte keys')
|
|
219
|
+
}
|
|
220
|
+
for (const [name, value] of Object.entries({
|
|
221
|
+
broadcastNamespaceId: context.broadcastNamespaceId,
|
|
222
|
+
trackName: context.trackName,
|
|
223
|
+
codec: context.codec,
|
|
224
|
+
timing: context.timing,
|
|
225
|
+
fecGeometry: context.fecGeometry,
|
|
226
|
+
})) {
|
|
227
|
+
if (value.length === 0) throw new Error(`manifest ${name} must not be empty`)
|
|
228
|
+
}
|
|
229
|
+
this.#tracks.set(bindingId, {
|
|
230
|
+
context: { ...context, bindingId },
|
|
231
|
+
groups: new Map(),
|
|
232
|
+
quarantine: [],
|
|
233
|
+
quarantinedBytes: 0,
|
|
234
|
+
capBytes: Math.ceil((context.bitrate * context.groupDurationMs) / 8000),
|
|
235
|
+
manifestEntries: 0,
|
|
236
|
+
maxManifestEntries: Math.ceil((context.bitrate * context.groupDurationMs) / (8000 * 52)),
|
|
237
|
+
maxGroups: context.mapper.d + 1,
|
|
238
|
+
})
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
ingestManifestFrame(bindingId: string, frameBytes: Uint8Array): void {
|
|
242
|
+
const track = this.#requireTrack(bindingId)
|
|
243
|
+
try {
|
|
244
|
+
const frame = decodeSourceAuthManifestFrame(frameBytes)
|
|
245
|
+
const groupId = frame.groupId
|
|
246
|
+
const group = this.#group(track, groupId)
|
|
247
|
+
if (frame.kind === 'object') {
|
|
248
|
+
if (group.close || group.signaturePending || group.failed) {
|
|
249
|
+
this.#failure({ trackName: track.context.trackName, bindingId, groupId, objectId: frame.objectId }, 'verifierError')
|
|
250
|
+
return
|
|
251
|
+
}
|
|
252
|
+
if (group.entries.has(frame.objectId)) {
|
|
253
|
+
this.#failure({ trackName: track.context.trackName, bindingId, groupId, objectId: frame.objectId }, 'verifierError')
|
|
254
|
+
return
|
|
255
|
+
}
|
|
256
|
+
if (group.entries.size >= 4096 || track.manifestEntries >= track.maxManifestEntries) {
|
|
257
|
+
this.#failure({ trackName: track.context.trackName, bindingId, groupId, objectId: frame.objectId }, 'verifierError')
|
|
258
|
+
return
|
|
259
|
+
}
|
|
260
|
+
group.entries.set(frame.objectId, frame)
|
|
261
|
+
track.manifestEntries++
|
|
262
|
+
const pending = group.pending.get(frame.objectId)
|
|
263
|
+
if (pending) {
|
|
264
|
+
this.#failure(pending.identity, 'manifestLate')
|
|
265
|
+
this.#resolvePending(track, group, pending, frame)
|
|
266
|
+
}
|
|
267
|
+
if (group.pendingClose && group.entries.size === group.pendingClose.objectCount) {
|
|
268
|
+
const close = group.pendingClose
|
|
269
|
+
group.pendingClose = undefined
|
|
270
|
+
this.#closeGroup(track, groupId, group, close)
|
|
271
|
+
}
|
|
272
|
+
return
|
|
273
|
+
}
|
|
274
|
+
this.#closeGroup(track, groupId, group, frame)
|
|
275
|
+
} catch {
|
|
276
|
+
this.#failure({ trackName: track.context.trackName, bindingId, groupId: 0, objectId: 0 }, 'verifierError')
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
admitObject(
|
|
281
|
+
identity: ManifestObjectIdentity,
|
|
282
|
+
data: Uint8Array,
|
|
283
|
+
release: () => void,
|
|
284
|
+
): ManifestAdmission {
|
|
285
|
+
if (this.#config.mode === 'off') {
|
|
286
|
+
release()
|
|
287
|
+
return { action: 'play', verified: false }
|
|
288
|
+
}
|
|
289
|
+
const track = this.#tracks.get(identity.bindingId ?? identity.trackName)
|
|
290
|
+
if (!track) {
|
|
291
|
+
release()
|
|
292
|
+
this.#failure(identity, 'verifierError')
|
|
293
|
+
return { action: 'play', verified: false, reason: 'verifierError' }
|
|
294
|
+
}
|
|
295
|
+
try {
|
|
296
|
+
if (!this.#validateIdentity(track, identity)) {
|
|
297
|
+
return this.#rejectOrShadow(identity, release, 'digestMismatch')
|
|
298
|
+
}
|
|
299
|
+
const group = this.#group(track, BigInt(identity.groupId))
|
|
300
|
+
if (group.failed === 'sigInvalid' || group.failed === 'digestMismatch') {
|
|
301
|
+
return this.#rejectOrShadow(identity, release, group.failed)
|
|
302
|
+
}
|
|
303
|
+
const entry = group.entries.get(identity.objectId)
|
|
304
|
+
if (entry) return this.#admitAgainstEntry(track, group, identity, data, release, entry)
|
|
305
|
+
if (this.#config.mode === 'shadow' || this.#config.onMissingManifest === 'fallback-shadow') {
|
|
306
|
+
release()
|
|
307
|
+
this.#failure(identity, 'manifestAbsent')
|
|
308
|
+
return { action: 'play', verified: false, reason: 'manifestAbsent' }
|
|
309
|
+
}
|
|
310
|
+
if (!this.#quarantine(track, group, { identity, data, release, bytes: data.byteLength })) {
|
|
311
|
+
return { action: 'drop', verified: false }
|
|
312
|
+
}
|
|
313
|
+
return { action: 'stall', verified: false }
|
|
314
|
+
} catch {
|
|
315
|
+
release()
|
|
316
|
+
this.#failure(identity, 'verifierError')
|
|
317
|
+
return { action: 'play', verified: false, reason: 'verifierError' }
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
dispose(): void {
|
|
322
|
+
if (this.#disposed) return
|
|
323
|
+
this.#disposed = true
|
|
324
|
+
this.#releaseAllQuarantine(false)
|
|
325
|
+
this.#tracks.clear()
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
#requireTrack(bindingId: string): TrackState {
|
|
329
|
+
const track = this.#tracks.get(bindingId)
|
|
330
|
+
if (!track) throw new Error(`unknown manifest binding ${bindingId}`)
|
|
331
|
+
return track
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
#group(track: TrackState, groupId: bigint): GroupState {
|
|
335
|
+
let group = track.groups.get(groupId)
|
|
336
|
+
if (!group) {
|
|
337
|
+
group = { entries: new Map(), pending: new Map(), rootVerified: false }
|
|
338
|
+
track.groups.set(groupId, group)
|
|
339
|
+
while (track.groups.size > track.maxGroups) {
|
|
340
|
+
const oldest = track.groups.entries().next().value as [bigint, GroupState] | undefined
|
|
341
|
+
if (!oldest) break
|
|
342
|
+
const [oldestId, oldestGroup] = oldest
|
|
343
|
+
for (const pending of [...oldestGroup.pending.values()]) {
|
|
344
|
+
this.#removePending(track, oldestGroup, pending)
|
|
345
|
+
pending.release()
|
|
346
|
+
// The group aged out with objects still waiting on a manifest that
|
|
347
|
+
// never arrived. That is an absent manifest, not a verifier fault:
|
|
348
|
+
// `verifierError` is reserved for an exception/crash in the verifier
|
|
349
|
+
// itself, so mislabelling here reads on the graduation dashboard as a
|
|
350
|
+
// software bug and hides a benign absent-manifest stall (BLO-30007).
|
|
351
|
+
this.#failure(pending.identity, 'manifestAbsent')
|
|
352
|
+
}
|
|
353
|
+
track.manifestEntries -= oldestGroup.entries.size
|
|
354
|
+
track.groups.delete(oldestId)
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return group
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
#validateIdentity(track: TrackState, identity: ManifestObjectIdentity): boolean {
|
|
361
|
+
const coordinates = track.context.mapper.derive(Number(identity.groupId), identity.objectId)
|
|
362
|
+
return identity.ssId === undefined || coordinates.ssId === identity.ssId
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
#admitAgainstEntry(
|
|
366
|
+
track: TrackState,
|
|
367
|
+
group: GroupState,
|
|
368
|
+
identity: ManifestObjectIdentity,
|
|
369
|
+
data: Uint8Array,
|
|
370
|
+
release: () => void,
|
|
371
|
+
entry: SourceAuthObjectEntry,
|
|
372
|
+
): ManifestAdmission {
|
|
373
|
+
if (entry.trueLength !== data.byteLength) {
|
|
374
|
+
return this.#rejectOrShadow(identity, release, 'digestMismatch')
|
|
375
|
+
}
|
|
376
|
+
const digestMatches = equalBytes(sourceAuthObjectDigest(data.subarray(0, entry.trueLength)), entry.digest)
|
|
377
|
+
if (!digestMatches) return this.#rejectOrShadow(identity, release, 'digestMismatch')
|
|
378
|
+
if (!track.context.manifestChannelAuthenticated && !group.rootVerified) {
|
|
379
|
+
if (this.#config.mode === 'shadow') {
|
|
380
|
+
release()
|
|
381
|
+
return { action: 'play', verified: false }
|
|
382
|
+
}
|
|
383
|
+
if (!this.#quarantine(track, group, { identity, data, release, bytes: data.byteLength })) {
|
|
384
|
+
return { action: 'drop', verified: false }
|
|
385
|
+
}
|
|
386
|
+
return { action: 'stall', verified: false }
|
|
387
|
+
}
|
|
388
|
+
release()
|
|
389
|
+
this.#stats.verified++
|
|
390
|
+
return { action: 'play', verified: true }
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
#rejectOrShadow(
|
|
394
|
+
identity: ManifestObjectIdentity,
|
|
395
|
+
release: () => void,
|
|
396
|
+
reason: 'digestMismatch' | 'sigInvalid',
|
|
397
|
+
): ManifestAdmission {
|
|
398
|
+
this.#failure(identity, reason)
|
|
399
|
+
if (this.#config.mode === 'enforce') {
|
|
400
|
+
console.warn(JSON.stringify({ event: 'manifest-enforce-drop', track: identity.trackName, group: String(identity.groupId), object: identity.objectId, reason }))
|
|
401
|
+
return { action: 'drop', verified: false, reason }
|
|
402
|
+
}
|
|
403
|
+
release()
|
|
404
|
+
return { action: 'play', verified: false, reason }
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
#resolvePending(
|
|
408
|
+
track: TrackState,
|
|
409
|
+
group: GroupState,
|
|
410
|
+
pending: PendingObject,
|
|
411
|
+
entry: SourceAuthObjectEntry,
|
|
412
|
+
): void {
|
|
413
|
+
this.#removePending(track, group, pending)
|
|
414
|
+
this.#admitAgainstEntry(track, group, pending.identity, pending.data, pending.release, entry)
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
#closeGroup(
|
|
418
|
+
track: TrackState,
|
|
419
|
+
groupId: bigint,
|
|
420
|
+
group: GroupState,
|
|
421
|
+
close: SourceAuthGroupClose,
|
|
422
|
+
): void {
|
|
423
|
+
if (group.close || group.signaturePending) return
|
|
424
|
+
const entries = [...group.entries.values()]
|
|
425
|
+
if (entries.length !== close.objectCount) {
|
|
426
|
+
// Manifest-channel reordering: the close frame beat some object entries.
|
|
427
|
+
// Stash it (latest-wins on duplicates) so the object-entry path can
|
|
428
|
+
// re-attempt the close once the count matches; quarantined objects stay
|
|
429
|
+
// quarantined, and manifestAbsent below is a signal, not an eviction.
|
|
430
|
+
group.pendingClose = close
|
|
431
|
+
const hadPending = group.pending.size > 0
|
|
432
|
+
if (this.#config.onMissingManifest === 'fallback-shadow' || this.#config.mode === 'shadow') {
|
|
433
|
+
for (const pending of [...group.pending.values()]) {
|
|
434
|
+
this.#removePending(track, group, pending)
|
|
435
|
+
pending.release()
|
|
436
|
+
this.#failure(pending.identity, 'manifestAbsent')
|
|
437
|
+
}
|
|
438
|
+
} else {
|
|
439
|
+
for (const pending of group.pending.values()) {
|
|
440
|
+
this.#failure(pending.identity, 'manifestAbsent')
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
if (!hadPending) {
|
|
444
|
+
this.#failure({ trackName: track.context.trackName, groupId, objectId: 0 }, 'manifestAbsent')
|
|
445
|
+
}
|
|
446
|
+
return
|
|
447
|
+
}
|
|
448
|
+
if (!equalBytes(sourceAuthMerkleRoot(entries), close.root)) {
|
|
449
|
+
group.failed = 'digestMismatch'
|
|
450
|
+
this.#failGroup(track, groupId, group, 'digestMismatch')
|
|
451
|
+
return
|
|
452
|
+
}
|
|
453
|
+
const preimage = sourceAuthSignaturePreimage(track.context.authScope, close.groupId, close.objectCount, close.root)
|
|
454
|
+
let signatureValid: boolean | Promise<boolean>
|
|
455
|
+
try {
|
|
456
|
+
signatureValid = this.#verifyAcceptedSignature(track, preimage, close.signature)
|
|
457
|
+
} catch {
|
|
458
|
+
this.#failOpenGroup(track, groupId, group)
|
|
459
|
+
return
|
|
460
|
+
}
|
|
461
|
+
if (isPromiseLike(signatureValid)) {
|
|
462
|
+
group.signaturePending = true
|
|
463
|
+
void signatureValid.then(
|
|
464
|
+
(valid) => {
|
|
465
|
+
if (this.#disposed) return
|
|
466
|
+
group.signaturePending = false
|
|
467
|
+
this.#finishGroupSignature(track, groupId, group, close, valid)
|
|
468
|
+
},
|
|
469
|
+
() => {
|
|
470
|
+
if (this.#disposed) return
|
|
471
|
+
group.signaturePending = false
|
|
472
|
+
this.#failOpenGroup(track, groupId, group)
|
|
473
|
+
},
|
|
474
|
+
)
|
|
475
|
+
return
|
|
476
|
+
}
|
|
477
|
+
this.#finishGroupSignature(track, groupId, group, close, signatureValid)
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
#finishGroupSignature(
|
|
481
|
+
track: TrackState,
|
|
482
|
+
groupId: bigint,
|
|
483
|
+
group: GroupState,
|
|
484
|
+
close: SourceAuthGroupClose,
|
|
485
|
+
signatureValid: boolean,
|
|
486
|
+
): void {
|
|
487
|
+
if (!signatureValid) {
|
|
488
|
+
group.failed = 'sigInvalid'
|
|
489
|
+
this.#failGroup(track, groupId, group, 'sigInvalid')
|
|
490
|
+
return
|
|
491
|
+
}
|
|
492
|
+
group.failed = undefined
|
|
493
|
+
group.close = close
|
|
494
|
+
group.pendingClose = undefined
|
|
495
|
+
group.rootVerified = true
|
|
496
|
+
for (const pending of [...group.pending.values()]) {
|
|
497
|
+
const entry = group.entries.get(pending.identity.objectId)
|
|
498
|
+
if (entry) this.#resolvePending(track, group, pending, entry)
|
|
499
|
+
else if (this.#config.onMissingManifest === 'fallback-shadow') {
|
|
500
|
+
this.#removePending(track, group, pending)
|
|
501
|
+
pending.release()
|
|
502
|
+
this.#failure(pending.identity, 'manifestAbsent')
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
#verifyAcceptedSignature(
|
|
508
|
+
track: TrackState,
|
|
509
|
+
message: Uint8Array,
|
|
510
|
+
signature: Uint8Array,
|
|
511
|
+
): boolean | Promise<boolean> {
|
|
512
|
+
const keys = track.context.acceptedPublicKeys ?? [track.context.publicKey]
|
|
513
|
+
const pending: Promise<boolean | 'error'>[] = []
|
|
514
|
+
let hadSynchronousError = false
|
|
515
|
+
for (const key of keys) {
|
|
516
|
+
try {
|
|
517
|
+
const result = this.#verifySignature(key, message, signature)
|
|
518
|
+
if (isPromiseLike(result)) {
|
|
519
|
+
pending.push(Promise.resolve(result).then((valid) => valid, () => 'error' as const))
|
|
520
|
+
} else if (result) {
|
|
521
|
+
return true
|
|
522
|
+
}
|
|
523
|
+
} catch {
|
|
524
|
+
hadSynchronousError = true
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
if (pending.length === 0) {
|
|
528
|
+
if (hadSynchronousError) throw new Error('manifest signature verifier unavailable')
|
|
529
|
+
return false
|
|
530
|
+
}
|
|
531
|
+
return Promise.all(pending).then((results) => {
|
|
532
|
+
if (results.some((valid) => valid === true)) return true
|
|
533
|
+
if (hadSynchronousError || results.some((valid) => valid === 'error')) {
|
|
534
|
+
throw new Error('manifest signature verifier unavailable')
|
|
535
|
+
}
|
|
536
|
+
return false
|
|
537
|
+
})
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
#failGroup(
|
|
541
|
+
track: TrackState,
|
|
542
|
+
groupId: bigint,
|
|
543
|
+
group: GroupState,
|
|
544
|
+
reason: 'digestMismatch' | 'sigInvalid',
|
|
545
|
+
): void {
|
|
546
|
+
if (group.pending.size === 0) {
|
|
547
|
+
this.#failure({ trackName: track.context.trackName, groupId, objectId: 0 }, reason)
|
|
548
|
+
return
|
|
549
|
+
}
|
|
550
|
+
for (const pending of [...group.pending.values()]) {
|
|
551
|
+
this.#removePending(track, group, pending)
|
|
552
|
+
this.#rejectOrShadow(pending.identity, pending.release, reason)
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
#removePending(track: TrackState, group: GroupState, pending: PendingObject): void {
|
|
557
|
+
if (group.pending.get(pending.identity.objectId) === pending) {
|
|
558
|
+
group.pending.delete(pending.identity.objectId)
|
|
559
|
+
}
|
|
560
|
+
const index = track.quarantine.indexOf(pending)
|
|
561
|
+
if (index >= 0) track.quarantine.splice(index, 1)
|
|
562
|
+
track.quarantinedBytes -= pending.bytes
|
|
563
|
+
this.#stats.quarantinedBytes -= pending.bytes
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
#quarantine(track: TrackState, group: GroupState, pending: PendingObject): boolean {
|
|
567
|
+
if (group.pending.has(pending.identity.objectId)) return false
|
|
568
|
+
group.pending.set(pending.identity.objectId, pending)
|
|
569
|
+
track.quarantine.push(pending)
|
|
570
|
+
track.quarantinedBytes += pending.bytes
|
|
571
|
+
this.#stats.quarantinedBytes += pending.bytes
|
|
572
|
+
this.#enforceCap(track)
|
|
573
|
+
return true
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
#enforceCap(track: TrackState): void {
|
|
577
|
+
while (track.quarantinedBytes > track.capBytes && track.quarantine.length > 0) {
|
|
578
|
+
const pending = track.quarantine.shift()!
|
|
579
|
+
const group = track.groups.get(BigInt(pending.identity.groupId))
|
|
580
|
+
if (group) group.pending.delete(pending.identity.objectId)
|
|
581
|
+
track.quarantinedBytes -= pending.bytes
|
|
582
|
+
this.#stats.quarantinedBytes -= pending.bytes
|
|
583
|
+
pending.release()
|
|
584
|
+
// Quarantine budget ran out while the object was still waiting on a
|
|
585
|
+
// manifest. The manifest was absent when we gave up; the verifier did not
|
|
586
|
+
// fault. Same reason in shadow and enforce so the dashboard reads one
|
|
587
|
+
// taxonomy across modes (BLO-30007).
|
|
588
|
+
this.#failure(pending.identity, 'manifestAbsent')
|
|
589
|
+
console.warn(`[ManifestVerifier] quarantine cap eviction fail-open track=${pending.identity.trackName} group=${pending.identity.groupId} object=${pending.identity.objectId}`)
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
#failOpenTrack(track: TrackState, reason: 'verifierError'): void {
|
|
594
|
+
for (const pending of [...track.quarantine]) {
|
|
595
|
+
const group = track.groups.get(BigInt(pending.identity.groupId))
|
|
596
|
+
if (group) this.#removePending(track, group, pending)
|
|
597
|
+
pending.release()
|
|
598
|
+
this.#failure(pending.identity, reason)
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
#failOpenGroup(track: TrackState, groupId: bigint, group: GroupState): void {
|
|
603
|
+
const pending = [...group.pending.values()]
|
|
604
|
+
if (pending.length === 0) {
|
|
605
|
+
this.#failure({ trackName: track.context.trackName, groupId, objectId: 0 }, 'verifierError')
|
|
606
|
+
return
|
|
607
|
+
}
|
|
608
|
+
for (const object of pending) {
|
|
609
|
+
this.#removePending(track, group, object)
|
|
610
|
+
object.release()
|
|
611
|
+
this.#failure(object.identity, 'verifierError')
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
#releaseAllQuarantine(countFailure: boolean): void {
|
|
616
|
+
for (const track of this.#tracks.values()) {
|
|
617
|
+
for (const pending of [...track.quarantine]) {
|
|
618
|
+
const group = track.groups.get(BigInt(pending.identity.groupId))
|
|
619
|
+
if (group) this.#removePending(track, group, pending)
|
|
620
|
+
pending.release()
|
|
621
|
+
if (countFailure) this.#failure(pending.identity, 'verifierError')
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
#failure(identity: ManifestObjectIdentity, reason: ManifestFailureReason): void {
|
|
627
|
+
this.#stats.failures[reason]++
|
|
628
|
+
this.#onFailure?.({
|
|
629
|
+
trackName: identity.trackName,
|
|
630
|
+
...(identity.bindingId === undefined ? {} : { bindingId: identity.bindingId }),
|
|
631
|
+
groupId: identity.groupId,
|
|
632
|
+
objectId: identity.objectId,
|
|
633
|
+
reason,
|
|
634
|
+
})
|
|
635
|
+
}
|
|
636
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|