Skip to content
A port of auth0/jsonwebtoken for Deno
TypeScript
Branch: master
Clone or download
jeroenptrs feat: implement barebones sign function
* Slight modifications to jsrsasign:
  * removed declaration of 'crypto' for Deno
  * removed declaration of window
  * edited exports to only export jws namespace
* barebones sign function
* typings for header (JwtHeader) and payload (SignPayload)
Latest commit e7d146e Jul 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib feat: implement barebones sign function Jul 11, 2019
src feat: implement barebones sign function Jul 11, 2019
.darnrc.json feat: implement barebones sign function Jul 11, 2019
.gitignore feat: implement barebones sign function Jul 11, 2019
README.md
mod.ts feat: implement barebones sign function Jul 11, 2019

README.md

[WIP] JWT

A port of auth0/jsonwebtoken using jsrsasign's jws library.

NOTICE: this is very much a work in progress until it reaches 1.0 status

https://img.shields.io/github/tag/denoserverless/jwt.svg?label=release

// example.ts
import { sign, SignPayload } from "https://cdn.jsdelivr.net/gh/denoserverless/jwt/mod.ts";

const payload: SignPayload = {
  greeting: "world",
};

const jwt = sign({}, payload, "hello");

console.log(jwt);
deno ./example.ts
# eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJncmVldGluZyI6IndvcmxkIn0.I5gqoVkPztoa07kuWyYWSA5uxg7JbdXqt066gFubX1o

Roadmap

  • Proof of Concept sign with jsrsasign
  • Proof of Concept decode with jsrsasign
  • Proof of Concept verify with jsrsasign
  • Fully implement sign, decode, verify
  • Optional: move away from jsrsasign (it's slow)
  • Eventually: move cryptography to Deno's built in cryptography

Changelog

0.1.0

feat: implement barebones sign function

  • Slight modifications to jsrsasign:
    • removed declaration of 'crypto' for Deno
    • removed declaration of window
    • edited exports to only export jws namespace
  • barebones sign function
  • typings for header (JwtHeader) and payload (SignPayload)
You can’t perform that action at this time.