auth

package module
v0.0.0-...-4fded36 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	/**
	Should outsorced to utils for security purpose but for now this would do
	*/
	AUTH_TOKEN_SECRET = "=kVsu2{G9'{'K<>d"
)
View Source
const SALT = "s+rS?:wk&FeXN88EW"

Variables

This section is empty.

Functions

func BcryptCheck

func BcryptCheck(hashedPassword, password []byte) bool

func BcryptConvertTo

func BcryptConvertTo(username, password string) (string, error)

func BearerToken

func BearerToken(jwtToken []byte) string

func CheckTokenExpiry

func CheckTokenExpiry(expiry interface{}) bool

func ComposeBcryptPassword

func ComposeBcryptPassword(username, password string) []byte

func CreateToken

func CreateToken(mapClaims jwt.MapClaims, secret []byte) (string, error)

func GetAuthSecret

func GetAuthSecret() []byte

func KeyFunction

func KeyFunction(token *jwt.Token) (interface{}, error)

func ParseBearer

func ParseBearer(receivedToken string) string

func VerifyToken

func VerifyToken(authToken string, keyFunction func(token *jwt.Token) (interface{}, error)) (string, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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