brycx / pasetors

PASETOrs: PASETO tokens in pure Rust
MIT License
91 stars 11 forks source link

Add WASM/ WebAssembly support #36

Open achmadk opened 2 years ago

achmadk commented 2 years ago

Hello, @brycx . Your library is awesome. I hope I can use pasetors in my web app.

Although there are libraries which already implement PASETO using javascript programming language, unfortunately those aren't running well in browser environment. Those libraries can be used in node.js environment (run javascript inside server). Converting existing library which can be used in browser is not an easy task.

Nowadays, rust can be compiled into WebAssembly (or WASM for short), and then can be used in browser. If you don't mind, could you add WASM support for this library?

brycx commented 2 years ago

Hi Achmad,

Thank you very much for the kind words. Adding WASM support would makes sense, but you should know that this library can't support WASM with std enabled at the same time. This then leaves out the high-level APIs like local/public/claims, etc. meaning you'd have to use version4 module instead.

I still think adding WASM support in terms of checking that it compiles in CI would make sense regardless though. AFAICT, this should be a relatively simple change.

brycx commented 2 years ago

Re-opening due to possible investigation of using wasm-bindgen.

DotRed108 commented 6 months ago

was support coming?

DotRed108 commented 6 months ago

wasm support coming?

brycx commented 6 months ago

Hi @DotRed108

It's been some time since I last looked at WASM compilation for this. Are you having a specific issue regarding compiling to a web-assembly target, or something else?