remotePasswordHasher

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestQueueKey specifies the redis key that will be used for the request queue.
	RequestQueueKey = "gocrypt:RequestQueue"
	// ResponseKeyPrefix specifies the redis key prefix that will be used for response publishing.
	ResponseKeyPrefix = "gocrypt:Response:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisPool added in v0.0.7

type RedisPool interface {
	Get() redis.Conn
	Close() error
}

RedisPool represents a generic, mockable redigo pool.

type RemotePasswordHasher

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

RemotePasswordHasher performs password hashing using a remote gocrypt hashing agent accessible through the provided redis pool.

func New

func New(cost int, timeout time.Duration, pool RedisPool) (ph *RemotePasswordHasher, err error)

New returns a PasswordHasher instance relying on a remote gocrypt agent to perform the hashing. This validates the connection and cost, and returns an error if there is a problem.

func (RemotePasswordHasher) HashPassword

func (r RemotePasswordHasher) HashPassword(password string) (hash string, err error)

HashPassword hashes the provided password using a remote gocrypt agent.

func (RemotePasswordHasher) ValidatePassword

func (r RemotePasswordHasher) ValidatePassword(password string, hash string) (isValid bool, err error)

ValidatePassword validates the password against the provided password hash using a remote gocrypt agent.

Jump to

Keyboard shortcuts

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