auth

package
v0.0.0-...-c427842 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(pwd []byte) ([]byte, error)

HashPassword takes a password and returns the hash

func PasswordMatches

func PasswordMatches(hash []byte, password []byte) bool

PasswordMatches takes a hash and a password and validates if they match

Types

type TokenManager

type TokenManager struct {
	// contains filtered or unexported fields
}

func NewTokenManager

func NewTokenManager(key string) TokenManager

func (TokenManager) CreateToken

func (t TokenManager) CreateToken(username string) (string, error)

func (TokenManager) ValidateAuthInterceptor

func (t TokenManager) ValidateAuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func (TokenManager) ValidateToken

func (t TokenManager) ValidateToken(token string) error

Jump to

Keyboard shortcuts

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