mail-auth
mail-auth copied to clipboard
feat: support wasm
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
andmail-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 }