auth

package
v0.0.0-...-20359fc Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password []byte, salt []byte) []byte

func RefreshToken

func RefreshToken(id uint64) (token string, dbPart []byte)

func Revoke

func Revoke(userId uint64)

func Salt

func Salt() []byte

func SelfEncodeToken

func SelfEncodeToken(id uint64, i interface{}) string

func SetSelfEncodedTokenLifeTime

func SetSelfEncodedTokenLifeTime(t time.Duration)

func ValidateRefreshToken

func ValidateRefreshToken(token string) (id uint64, valid bool, dbPart []byte)

Types

type Token

type Token struct {
	Issued   time.Time
	Expire   time.Time
	Id       uint64
	Metadata interface{}
}

func ValidateSelfEncoded

func ValidateSelfEncoded(token string) (t Token, v bool)

Jump to

Keyboard shortcuts

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