This is a draft PR that still needs work! It's open to initial feedback, but see the remaining tasks section to get an idea of what needs to be implemented.
[x] Add ucan-wasm crate with JavaScript packaging support
[x] Add packaging support for browser, node, deno, and workerd targets (workerd is Cloudflare workers)
Link to issue
Implements #93
Type of change
[x] New feature (non-breaking change that adds functionality)
Test plan (required)
The test suite includes unit tests for each function. Tests read from a set of fixtures written in the style of the spec repo fixtures (https://github.com/ucan-wg/spec/tree/main/fixtures/0.8.1) but upgraded to UCAN 0.9.0. (Side note: It would be nice to eventually add these to the spec repo and pull them from there.)
The tests are run in node and headless browser environments including chromium, firefox, and webkit.
Remaining tasks
[ ] Upgrade to UCAN 0.10.0
[ ] Convert test fixtures to UCAN 0.10.0
[ ] Optimize for size where possible
[ ] Investigate DID parsing options. Bringing in key support here doubles the size of the Wasm binary:
This is a draft PR that still needs work! It's open to initial feedback, but see the remaining tasks section to get an idea of what needs to be implemented.
Description
This PR implements the following features:
checkSignature
,decode
,isExpired
,isTooEarly
,toCID
,validate
functionsucan-wasm
crate with JavaScript packaging supportbrowser
,node
,deno
, andworkerd
targets (workerd
is Cloudflare workers)Link to issue
Implements #93
Type of change
Test plan (required)
The test suite includes unit tests for each function. Tests read from a set of fixtures written in the style of the spec repo fixtures (https://github.com/ucan-wg/spec/tree/main/fixtures/0.8.1) but upgraded to UCAN 0.9.0. (Side note: It would be nice to eventually add these to the spec repo and pull them from there.)
The tests are run in
node
and headless browser environments includingchromium
,firefox
, andwebkit
.Remaining tasks
https://github.com/ucan-wg/rs-ucan/blob/8520742bad4de0f9ba4d5f3004a7292d27cf363e/ucan-wasm/src/ucan/verify.rs#L15-L19
deno
testsworkerd
tests (if possible)