auth

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const TOKEN_VALID_TIME = 1 * time.Hour // TODO: Change to 5 minutes for prod

Variables

View Source
var JWT_SIGNING_KEY []byte

Functions

func GetUserInfo

func GetUserInfo(c *gin.Context) (types.Claims, types.Error)

func Initialize

func Initialize()

func IsAuthed

func IsAuthed(username string, password string) (bool, error)

func IsEntitled

func IsEntitled(claims types.Claims, requirement string) bool

func NewToken

func NewToken(username string, role string, id string) (string, types.Error)

func RefreshToken

func RefreshToken(c *gin.Context) (string, types.Error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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