c2pa-rs icon indicating copy to clipboard operation
c2pa-rs copied to clipboard

Expose authoring support in WASM

Open duggaraju opened this issue 2 years ago • 7 comments

Changes in this pull request

Expose async version of 'embed_from_memory' which can be called from wasm.

Checklist

Since signing methods in the JavaScript land are async need to use AsyncSigner for signing. So created an embed_from_memory_async API combine sign_claim and sign_claim_async into a single function using async_generic macro. Created a WebCryptoSigner type that implements AsyncSigner and used that for the test case.

duggaraju avatar Jan 23 '24 20:01 duggaraju

I have not forgotten about this PR. We are working through a few PRs before this that have similar changes.

mauricefisher64 avatar Feb 20 '24 15:02 mauricefisher64

Can you bring this up to date with main. Thanks. Things are changing fast internally so need to make sure this is still accurate.

mauricefisher64 avatar Mar 29 '24 14:03 mauricefisher64

rebased to latest on the main branch and resolved conflicts.

duggaraju avatar Mar 29 '24 18:03 duggaraju

Looks like wasm-tests are failing post rebase. Let me fix those. Not sure the other code coverage related failures.

duggaraju avatar Apr 01 '24 15:04 duggaraju

Fix WASM tests and issues after rebasing to latest on main. Fix clippy/fmt issues.

duggaraju avatar Apr 01 '24 18:04 duggaraju

@mauricefisher64 can you approve the workflow again.

duggaraju avatar Apr 04 '24 18:04 duggaraju

I understood the test failure. The change to AsyncSigner broke the default implementation of SyncSigner. Changed both to be identical now. @mauricefisher64 please review change to signer.rs and timestamp.rs and then you can enable the workflow again.

duggaraju avatar Apr 04 '24 22:04 duggaraju

Thanks @gpeacock for approving the changes. Let me know if anything is needed before this can be merged.

duggaraju avatar Apr 25 '24 16:04 duggaraju

Codecov Report

Attention: Patch coverage is 84.54545% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 79.63%. Comparing base (1a2711a) to head (874d8de).

Files Patch % Lines
sdk/src/signer.rs 58.33% 10 Missing :warning:
sdk/src/manifest.rs 45.45% 6 Missing :warning:
sdk/src/store.rs 97.14% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #369   +/-   ##
=======================================
  Coverage   79.62%   79.63%           
=======================================
  Files          87       87           
  Lines       27276    27277    +1     
=======================================
+ Hits        21719    21722    +3     
+ Misses       5557     5555    -2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 25 '24 17:04 codecov-commenter