security

package
v0.0.0-...-e6c6cbb Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHash

func CheckHash(pass string, hashedPass string) bool

func CheckJWT

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

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

func GetJWTFromUserPass

func GetJWTFromUserPass(email string) (string, error)

func HashPassword

func HashPassword(pass string) (string, error)

Types

type Security

type Security interface {
	CheckUser(r *http.Request) (bool, string, error)
	GetProtocolFromDomain(todomain string) (string, error)

	VerifyEmailServer(mail sql.ReceivedMessage) error
	VerifyEmailSender(mail sql.ReceivedMessage) error
	VerifyMessage(mail sql.ReceivedMessage) (bool, error)
}

func NewSecurity

func NewSecurity(db sql.SQL, logger *zap.SugaredLogger) Security

Jump to

Keyboard shortcuts

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