Built with 🦀🕸 by Achmad Kurnianto
PASETO is everything you love about JOSE (JWT, JWE, JWS) without any of the many design deficits that plague the JOSE standards. According to the paseto.io website, there is no PASETO library supported for JavaScript browsers yet. Library paseto from Filip Skokan only supports nodejs, and paseto.js from Samuel Judson from now uses deprecated versions 1 and 2 implementations of PASETO.
Luckily, there are PASETO libraries implemented with the rust programming language, which can be compiled into WebAssembly. One of them is pasetors
from Johannes, which has WASM support but is not fully tested.
The creator of pasetors
also lacks experience using JavaScript programming language and publishing it to the npm registry. I hope this crate will help him and improve WASM support of pasetors
.
This crate will produce 2 separate npm libraries each called @achmadk/pasetors-wasm
(support JavaScript browser) and @achmadk/pasetors-wasm-node
(support nodejs).
yarn add @achmadk/pasetors-wasm # for browser, or
yarn add @achmadk/pasetors-wasm-node # for nodejs
v4.localToken.encrypt
v4.localToken.decrypt
v4.publicToken.sign
v4.publicToken.verify
wasm-pack build --release -t web -s achmadk --out-dir pkg/pasetors-wasm --out-name pasetors-wasm # for browser
wasm-pack build --release -t nodejs -s achmadk --out-dir pkg/pasetors-wasm-node --out-name pasetors-wasm-node # for nodejs
wasm-pack test --headless
wasm-pack test --chrome --firefox
wasm-pack test --node
For more information about contributing, please read this file
wasm-bindgen
for communicating between WebAssembly and JavaScript.console_error_panic_hook
for logging panic messages to the developer console.wee_alloc
, an allocator optimized for small code size.pasetors
for implementing PASETO with rust programming language.