server

package
v0.0.0-...-14137fd Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwtSecret = []byte("secret")

Functions

func GetEnvWithDefault

func GetEnvWithDefault(key string, fallback string) string

func ParseToken

func ParseToken(tokenString string) (jwt.MapClaims, error)

func PassJwtContext

func PassJwtContext(next http.Handler) http.Handler

func RequireAuth

func RequireAuth(jwt string, callback func() (interface{}, error)) (interface{}, error)

Helper middleware func for wrapping certain queries in auth verification E.g: RequireAuth(jwt, someQuery)

func ValidateJWT

func ValidateJWT(jwtToken string) (bool, error)

Types

This section is empty.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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