Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
/ branca Public archive
forked from hako/branca

🔑 Secure alternative to JWT. Authenticated Encrypted API Tokens for Go.

License

Notifications You must be signed in to change notification settings

CanonicalLtd/branca

 
 

Repository files navigation

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

🔑 Secure alternative to JWT. Authenticated Encrypted API Tokens for Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%