No description
Find a file
2021-11-11 22:05:17 +01:00
.github test(node): refactor to run only cjs in node 12, else esm 2021-11-10 16:47:41 +01:00
docs docs: mention signed JWT alg as required 2021-11-11 20:14:12 +01:00
patches fix(typescript): JWTExpired error TS2417 2021-10-14 12:13:38 +02:00
src fix(typescript): Signed JWT Header Parameters has alg as required and b64 as never 2021-11-11 22:05:17 +01:00
test fix: createRemoteJWKSet handles all JWS syntaxes 2021-11-11 22:05:17 +01:00
test-browser fix: createRemoteJWKSet handles all JWS syntaxes 2021-11-11 22:05:17 +01:00
test-cloudflare-workers fix: createRemoteJWKSet handles all JWS syntaxes 2021-11-11 22:05:17 +01:00
test-deno fix: createRemoteJWKSet handles all JWS syntaxes 2021-11-11 22:05:17 +01:00
tools build: strip alternate distro package.json 2021-11-11 15:21:41 +01:00
tsconfig refactor: redo exports to support broader tooling 2021-10-14 14:08:05 +02:00
.c8rc.json
.gitignore test(node): refactor to run only cjs in node 12, else esm 2021-11-10 16:47:41 +01:00
.prettierignore
.prettierrc.json style: global prettierc 2021-10-27 17:47:13 +02:00
.versionrc.json chore: not everything is a Bug Fix per se, something is just a Fix 2021-11-01 16:42:11 +01:00
ava.config.cjs test(node): refactor to run only cjs in node 12, else esm 2021-11-10 16:47:41 +01:00
CHANGELOG.md chore(release): 4.3.0 2021-11-11 17:14:02 +01:00
CODE_OF_CONDUCT.md chore: update coc 2021-07-20 12:50:11 +02:00
CONTRIBUTING.md docs: update coc link 2021-07-15 11:06:48 +02:00
karma.conf.js test(browsers): run all tests again 2021-09-15 10:27:58 +02:00
LICENSE.md
package.json chore(release): 4.3.0 2021-11-11 17:14:02 +01:00
README.md docs: update readmes and examples 2021-11-10 15:19:37 +01:00
test-cloudflare-workers.config.cjs ci: test with Cloudflare Workers 2021-09-07 10:42:28 +02:00

jose

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto in Node.js, Browser, Cloudflare Workers, Electron, and Deno.

Implemented specs & features

The following specifications are implemented by jose

The test suite utilizes examples defined in RFC7520 to confirm its JOSE implementation is correct.

Support

If you or your business use jose, please consider becoming a sponsor so I can continue maintaining it and adding new features carefree.

Documentation

example ESM import

import * as jose from 'jose'

example CJS require

const jose = require('jose')

example Deno import

import * as jose from 'https://deno.land/x/jose/index.ts'

Supported Runtimes, Environments, Platforms

FAQ

Supported Versions

Version Security Fixes 🔑 Other Bug Fixes 🐞 New Features
4.x.x
3.x.x until 2022-04-30
2.x.x until 2022-04-30
1.x.x

Semver?

Yes. All module's public API is subject to Semantic Versioning 2.0.0.

How is it different from jws, jwa or jsonwebtoken?

  • it supports Browser, Cloudflare Workers, and Deno runtimes
  • it supports encrypted JWTs (i.e. in JWE format)
  • supports secp256k1, Ed25519, Ed448, X25519, and X448
  • it supports JWK Key Format for all four key types (oct, RSA, EC and OKP)
  • it is exclusively using native platform Key object representations (CryptoKey and KeyObject)
  • there is JSON Web Encryption support
  • it supports the flattened JWS / JWE Serialization Syntaxes
  • it supports the "crit" member validations to make sure extensions are handled correctly

How is it different from node-jose?

node-jose is built to work in any javascript runtime, to be able to do that it packs a lot of polyfills and javascript implementation code in the form of node-forge, this significantly increases the footprint of the modules with dependencies that either aren't ever used or have native implementation available in the runtime already, those are often times faster and more reliable.

  • supports secp256k1, Ed25519, Ed448, X25519, and X448

Uint8Array?!

  • Whenever Uint8Array is a valid input, so is Buffer since buffers are instances of Uint8Array.
  • Whenever Uint8Array is returned and you want a Buffer instead, use Buffer.from(uint8array).

Bundle Size, Package Size, Tree Shaking

Yes the bundle size is on the larger side, that is because each module is actually published multiple times so that it can remain truly without dependencies and be universal / isomorphic.

Nevertheless, since each module can be required independently and is fully tree-shakeable, the install size should not be a cause for concern.