CanonicalLtd / branca

:key: Secure alternative to JWT. Authenticated Encrypted API Tokens for Go.

Home Page:https://branca.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

branca

Build Status Go Report Card GoDoc

Branca is a secure alternative to JWT, This implementation is written in pure Go (no cgo dependencies) and implements the branca token specification.

It was originally forked from github.com/hako/branca and the API and implementation fairly extensively modified. Specifically:

  • the token payload is now []byte not string.
  • the client is responsible for checking timestamp expiry, which simplifies the API and makes it possible to use a different expiry duration based on the payload contents.
  • it's possible for external code to choose the nonce and timestamp, which is useful for tests.
  • the external basex dependency has been removed.
  • encoding a token no longer returns an error.
  • the base62 wrapping is now optional, making it efficient to fold a token into some other binary format without incurring double-encoding cost.
  • less work is done for each encoding and decoding (the encrypter and the base62 encoder are created only once)

Requirements

Go 1.10 and beyond.

Install

go get -u github.com/CanonicalLtd/branca

See the godoc for examples and more information on the API.

About

:key: Secure alternative to JWT. Authenticated Encrypted API Tokens for Go.

https://branca.io

License:MIT License


Languages

Language:Go 100.0%