token

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

token provides JWT validation and parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(keys []string, exp int64, jti string, admin int) (string, error)

func Info

Info return jwt token information.

func IsAdmin

func IsAdmin(w http.ResponseWriter, rc http.Request) (error, http.Request)

IsAdmin Only continue if the requestor is an admin.

func New

IssueJWT return a valid jwt with these statically defined scope values.

func Parse

Types

type JwtClaimsMap

type JwtClaimsMap struct {
	Keys       []string `json:"keys"`
	Admin      int      `json:"admin"`
	JWTid      string   `json:"jti"`
	Expiration int64    `json:"exp"`
	jwt.StandardClaims
}

type RequestDecrypt

type RequestDecrypt struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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