password

package
v0.0.0-...-d3d53d6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitModels

func InitModels()

InitModels initializes models in mongo, if required.

Types

type Manager

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

Manager stores and validates passwords

func NewManager

func NewManager(r *http.Request) *Manager

NewManager creates a new Manager

func (*Manager) DeleteResetToken

func (pwm *Manager) DeleteResetToken(token string) (err error)

DeleteResetToken delete reset token by token

func (*Manager) FindResetToken

func (pwm *Manager) FindResetToken(token string) (tokenobj *ResetToken, err error)

FindResetToken find reset token by token

func (*Manager) NewResetToken

func (pwm *Manager) NewResetToken(username string) (token *ResetToken, err error)

NewResetToken get new reset token

func (*Manager) Save

func (pwm *Manager) Save(username, password string) error

Save stores a password for a specific username.

func (*Manager) SaveResetToken

func (pwm *Manager) SaveResetToken(token *ResetToken) (err error)

SaveResetToken save reset token

func (*Manager) Validate

func (pwm *Manager) Validate(username, password string) (bool, error)

Validate checks the password for a specific username

type ResetToken

type ResetToken struct {
	Username  string
	Token     string
	CreatedAt time.Time
}

Directories

Path Synopsis
crypt
Package crypt provides interface for password crypt functions and collects common constants.
Package crypt provides interface for password crypt functions and collects common constants.
crypt/sha512crypt
Package sha512crypt implements Ulrich Drepper's SHA512-crypt password hashing algorithm.
Package sha512crypt implements Ulrich Drepper's SHA512-crypt password hashing algorithm.

Jump to

Keyboard shortcuts

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