mail-auth icon indicating copy to clipboard operation
mail-auth copied to clipboard

feat: support wasm

Open olehmisar opened this issue 5 months ago • 0 comments

I needed to parse dkim signature in js and this is the only good library I found. These are the changed I applied in order to compile this library to WASM. Consider using these changes as a reference if you want to add WASM support to this library natively.

Overview:

  • hide resolver behind a feature flag because mio is not supported in WASM
  • use WASM-compatible features of zip and mail-builder crates
  • made get_canonicalized_header non-async because it does not need to be.

For those who want to use this library in a WASM project, you can install my fork like this:

[dependencies]
wasm-bindgen = "0.2.84"
ring = { version = "0.17.7", features = ["wasm32_unknown_unknown_js"] }
getrandom = {version ="0.2.15", features = ["js"] }
mail-auth = { git="https://github.com/olehmisar/mail-auth.git", rev="fb1d434", features=["ring"], default-features = false  }

olehmisar avatar Sep 07 '24 07:09 olehmisar