auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

package auth provides a common interface an registry for transforming passwords into a secure form.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compute

func Compute(authtype string, v []byte) ([]byte, error)

Compute takes a supplied value and transforms it into an authentication challenge using the supplied authtype.

func IsInvalidType

func IsInvalidType(err error) bool

IsInvalidType checks whether or not an error indicates an invalid auth type.

func Register

func Register(name string, cv ComputerVerifier) error

Register is called by the init() functions of authentication modules to register those modules at run time. Supplied names must be unique.

func Verify

func Verify(authtype string, challenge, attempt []byte) (bool, error)

Verify takes a precomputed authentication challenge and compares it to a supplied input to see if they match.

Types

type Computer

type Computer interface {
	Compute(v []byte) ([]byte, error)
}

Computer objects can take a user-supplied value and compute an authentication challenge

type ComputerVerifier

type ComputerVerifier interface {
	Computer
	Verifier
}

ComputerVerifier objects implement both Computer and Verifier functionality.

type InvalidType

type InvalidType interface {
	IsInvalidType() bool
}

type Verifier

type Verifier interface {
	Verify(challenge, attempt []byte) bool
}

Verifier objects can take a stored authentication challenge (e.g. a hash) and determine if the provided attempt value matches.

Directories

Path Synopsis
package bcrypt implements the bcrypt algorithm as an authentication method.
package bcrypt implements the bcrypt algorithm as an authentication method.

Jump to

Keyboard shortcuts

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