Skip to content

chore: Enable sync CAWG validation#2120

Merged
gpeacock merged 7 commits into
mainfrom
gpeacock/cawg_sync
May 15, 2026
Merged

chore: Enable sync CAWG validation#2120
gpeacock merged 7 commits into
mainfrom
gpeacock/cawg_sync

Conversation

@gpeacock
Copy link
Copy Markdown
Member

@gpeacock gpeacock commented May 7, 2026

We currently will auto validate CAWG identity when the verify apis are called async, but not when they are called synchronously (it silently logs a warning and skips validation).

This allows cawg verification in sync calls by default. Identity validation can be disabled with a setting.

c_ffi no longer needs a tokio runtime to block on async validation.

@gpeacock gpeacock requested a review from scouten-adobe May 7, 2026 21:13
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 7, 2026

Merging this PR will not alter performance

✅ 30 untouched benchmarks
⏩ 64 skipped benchmarks1


Comparing gpeacock/cawg_sync (f451ff1) with main (d000b52)

Open in CodSpeed

Footnotes

  1. 64 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

gpeacock added 5 commits May 11, 2026 17:18
Sync and async paths in validate_partial_claim now run equivalently,
so callers no longer need to call post_validate_async / CawgValidator
as a separate step after loading a Reader. Removes the post_validate
wrapper from c2pa_c_ffi, the validate_cawg helper from c2patool, and
the manual post_validate_async call from the SDK integration test.

Adds fn check_signature (sync) alongside the renamed async fn
check_signature_async on SignatureVerifier and all implementations
(IcaSignatureVerifier, X509SignatureVerifier, BuiltInSignatureVerifier,
NaiveSignatureVerifier). IcaSignatureVerifier uses async_generic to
unify the two check_issuer_signature variants; did:web is sync-guarded.

Tests that need raw CBOR access use read_manifest with
decode_identity_assertions=false.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 78.33333% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.28%. Comparing base (3ce6250) to head (f451ff1).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
sdk/src/identity/x509/x509_signature_verifier.rs 6.25% 15 Missing ⚠️
...entity/claim_aggregation/ica_signature_verifier.rs 87.50% 7 Missing ⚠️
sdk/src/identity/identity_assertion/assertion.rs 86.95% 6 Missing ⚠️
.../identity_assertion/built_in_signature_verifier.rs 16.66% 5 Missing ⚠️
cli/src/main.rs 0.00% 4 Missing ⚠️
c2pa_c_ffi/src/c_api.rs 94.73% 1 Missing ⚠️
sdk/src/reader.rs 96.42% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2120    +/-   ##
========================================
  Coverage   78.28%   78.28%            
========================================
  Files         177      177            
  Lines       45599    45735   +136     
========================================
+ Hits        35695    35805   +110     
- Misses       9904     9930    +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gpeacock gpeacock changed the title chore: enable sync cawg validation for x509 chore: enable sync cawg validation May 15, 2026
@tmathern
Copy link
Copy Markdown
Contributor

For even more improvements, please consider: #2152 (Other topic, other PR).

Copy link
Copy Markdown
Collaborator

@scouten-adobe scouten-adobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good. Thank you!

@scouten-adobe scouten-adobe changed the title chore: enable sync cawg validation chore: Enable sync CAWG validation May 15, 2026
@gpeacock gpeacock merged commit 87243f6 into main May 15, 2026
49 checks passed
@gpeacock gpeacock deleted the gpeacock/cawg_sync branch May 15, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants