jwtee

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package jwtee wraps github.com/dgrijalva/jwt-go with some tooling that makes it easier to use in most practical usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringClaim

func StringClaim(claims jwt.MapClaims, key string) (string, bool)

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

type Input

type Input struct {
	Secret string
	Aud    string
	Iss    string
	Alg    string
}

type Jwtee

type Jwtee struct {
	Secret []byte
	Aud    string
	Iss    string
	Alg    jwt.SigningMethod
}

func New

func New(input Input) (Jwtee, error)

func (Jwtee) BuildTtl

func (j Jwtee) BuildTtl(ttl time.Duration, moreClaims map[string]interface{}) (string, error)

func (Jwtee) Dup

func (j Jwtee) Dup(input Input) Jwtee

func (Jwtee) Parse

func (j Jwtee) Parse(tokenString string) (*jwt.Token, error)

func (Jwtee) ParseMapClaims

func (j Jwtee) ParseMapClaims(tokenString string) (jwt.MapClaims, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL