Documentation
¶
Overview ¶
Package password contains all code related to the password domain.
Index ¶
- Variables
- type Backend
- type Domain
- type Driver
- func (d Driver) AssignPassword(userID string, alg string, password string) error
- func (d Driver) AssignRandomPassword(userID string, alg string, domain Domain, length uint) error
- func (d Driver) GetHash(alg string, password string) (string, error)
- func (d Driver) GetHashAlgorithms() []string
- func (d Driver) GetRandomPassword(domain Domain, length uint) (string, error)
- type SecretPusher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LowerCaseLetters = NewDomain("abcdefghijklmnopqrstuvwxyz") UpperCaseLetters = NewDomain("ABCDEFGHIJKLMNOPQRSTUVWXYZ") Numbers = NewDomain("0123456789") ASCIISpecials = NewDomain(`!"#$%&'()*+,-./:;<=>?@[\]^_{|}~`) Letters = LowerCaseLetters.MergeWith(UpperCaseLetters) LettersAndNumbers = Letters.MergeWith(Numbers) // LettersAndNumbers will be more common than specials Standard = LettersAndNumbers.MergeWith(LettersAndNumbers).MergeWith(ASCIISpecials) )
Most common domains
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { GetPrincipalEmail(userID string) (string, error) SetUserPassword(userID string, hashedPassword string) error }
Backend interface.
type Domain ¶
Domain object contains information about characters used to construct a random secret string.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is the entry point of the domain that expose methods.
func NewDriver ¶
func NewDriver(backend Backend, spusher SecretPusher) Driver
NewDriver create a new domain driver with given driven implementations.
func (Driver) AssignPassword ¶
AssignPassword to the user with id, the secret is pushed to the user securely.
func (Driver) AssignRandomPassword ¶
AssignRandomPassword to the user with id, the secret is pushed to the user securely.
func (Driver) GetHashAlgorithms ¶
GetHashAlgorithms returns list of supported hash algorithms.
Click to show internal directories.
Click to hide internal directories.