security

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(username string) (string, error)

GenerateToken generates a JWT token with a configured token secret

func TokenCheck

func TokenCheck(next http.Handler) http.Handler

TokenCheck Middleware to secure endpoints

func ValidateToken

func ValidateToken(token *string) (bool, error)

ValidateToken validates an input token and tries to renew a token if close to expiring

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

Claims jwt claims container

Jump to

Keyboard shortcuts

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