defaultjwt

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDefaultClaims

func AddDefaultClaims(token jwt.Token) (jwt.Token, error)

AddDefaultClaims adds default claims to jwt

func AddJSONFileClaimsToToken

func AddJSONFileClaimsToToken(t jwt.Token, path string) (jwt.Token, error)

AddJSONFileClaimsToToken adds content of json file to token

func AddJSONStringClaimsToToken added in v0.0.4

func AddJSONStringClaimsToToken(t jwt.Token, s string) (jwt.Token, error)

AddJSONStringClaimsToToken parses the string and adds the claims to the token

func AddMapClaimsToToken added in v0.0.5

func AddMapClaimsToToken(t jwt.Token, cs map[string]string) (jwt.Token, error)

AddMapClaimsToToken adds all the properties of a map to the token

func NewToken

func NewToken() jwt.Token

NewToken returns a new token

func SignToken

func SignToken(token jwt.Token, key crypto.PrivateKey) (string, error)

SignToken signs a token and returns a string

Types

type DefaultClaims added in v0.0.4

type DefaultClaims struct {
	Key         string
	Value       string
	Description string
}

DefaultClaims is a structure that contains the default claims as well as a Description of how the Value was computed

func GetDefaultClaims added in v0.0.4

func GetDefaultClaims() []DefaultClaims

GetDefaultClaims returns a list of default claims. Default claims have been taken from rfc 7519

Jump to

Keyboard shortcuts

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