Skip to content

Commit e64e91f

Browse files
feat: sync/async HTTP resolvers API (#1355)
* feat: sync/async http resolvers API * fix: impl wasi sync/async http resolvers * fix: clean up http dependencies * fix: clean up resolver error types and unwraps * fix: use async generic resolver for cawg * fix: wasi tests and compilation * refactor: remove curl as sync http resolver * fix: simultaneous features, lints, and ci * fix: finish wasi and wasm impl * ci: fix wasm features * fix: wasm issues again * fix: wasm issues again * test: add generic http resolver tests * chore: clean up unnecessary changes * fix: do not expose http resolver in `Ingredient::from_stream_async` * docs: document new feature flags and WASM/WASI notes * fix: default to reqwest_blocking if ureq is also specified * fix: simplify feature flags for generic resolvers * ci: fix benchmarking to use proper http featuers * ci: define env before executing command for benchmarking * style: alphabetize http crate * ci: fix rust native crypto jobs * ci: revert rust_native_crypto changes for now * docs: simplify doc references * test: individual networking lib tests * build: remove wasi dep from fetch_remote_manifests feature * docs: add new features to usage.md * fix: use concrete resolver type instead of trait object * refactor: modularize http resolvers * fix: resolver imports * fix: wasm tests * fix: reqwest_blocking import issues * docs: remove comment stating http dependency can be optional * docs: clarify why we use certain http features in ci * docs: fix grammar * ci: add http features to release readiness * ci: run benchmarks with minimal featuers * fix: dependencies and test caused by merge * fix: allow timestamp assertion to be fetched on WASM * fix: support timestamping on WASM/WASI * fix: remove forbidden HOST header for WASI networking * docs: remove review note * fix: use write_all for WASI to bypass 4096 byte limit * fix: pipe http resolvers through timestamping * fix: default to ureq instead of reqwest_blocking until async tests are fixed * fix: WASM http resolver for timestamps * ci: use all features instead of excluding reqwest_blocking since we default to ureq * feat: add `default_http` feature for simplification * fix: add default_http as a feature of ffi and make test images * feat: add networking feature flag for c2patool * Capitalize HTTP consistently * Capitalize HTTP consistently * fix: add back http crate and fix mut variable * refactor: Plumb HTTP resolver through internals (#1513) * fix: pass http resolver to archive code, fix clippy lint, allow more timestamp fuctions for wasm * style: fix formatting to nightly --------- Co-authored-by: Eric Scouten <[email protected]>
1 parent 45acace commit e64e91f

File tree

39 files changed

+2019
-911
lines changed

39 files changed

+2019
-911
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
id: get-features
4343
run: |
4444
FEATURES=$(cargo metadata --format-version=1 | jq -r '[.packages[] | select(.name=="c2pa") | .features | keys | map(select(. != "default")) | .[]] | unique | join(" ")')
45+
4546
RUST_NATIVE_FEATURES=$(echo $FEATURES | sed 's/openssl//g')
4647
OPENSSL_FEATURES=$(echo $FEATURES | sed 's/rust_native_crypto//g')
4748
echo "rust-native-features=$RUST_NATIVE_FEATURES" >> "$GITHUB_OUTPUT"
@@ -315,7 +316,7 @@ jobs:
315316
run: cargo binstall -y wasm-bindgen-cli --version 0.2.105
316317

317318
- name: Run Wasm tests
318-
run: cargo test -p c2pa --no-default-features --features rust_native_crypto,fetch_remote_manifests --target wasm32-unknown-unknown
319+
run: cargo test -p c2pa --no-default-features --features rust_native_crypto,fetch_remote_manifests,http_reqwest --target wasm32-unknown-unknown
319320
env:
320321
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: wasm-bindgen-test-runner
321322
WASM_BINDGEN_TEST_TIMEOUT: 60

.github/workflows/release_readiness.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
id: get-features
3636
run: |
3737
FEATURES=$(cargo metadata --format-version=1 | jq -r '[.packages[] | select(.name=="c2pa") | .features | keys | map(select(. != "default")) | .[]] | unique | join(" ")')
38+
3839
RUST_NATIVE_FEATURES=$(echo $FEATURES | sed 's/openssl//g')
3940
OPENSSL_FEATURES=$(echo $FEATURES | sed 's/rust_native_crypto//g')
4041
echo "rust-native-features=$RUST_NATIVE_FEATURES" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)