Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DerivePasswordKey ¶
DerivePasswordKey calculates the key based on password and salt.
func SaltGenerator ¶
SaltGenerator generates a crypto-secure random salt.
Types ¶
type BasicAuth ¶
type BasicAuth struct {
// contains filtered or unexported fields
}
func NewBasicAuth ¶
func (*BasicAuth) VerifyUsernameAndPassword ¶
type BasicAuthManager ¶
type BasicAuthManager struct {
// contains filtered or unexported fields
}
BasicAuthManager is the same as BasicAuth but for multiple users.
func NewBasicAuthManager ¶
func NewBasicAuthManager(usersWithPasswordsHex map[string]string, passwordSaltHex string) (*BasicAuthManager, error)
func (*BasicAuthManager) Exists ¶
func (b *BasicAuthManager) Exists(username string) bool
func (*BasicAuthManager) VerifyUsernameAndPassword ¶
func (b *BasicAuthManager) VerifyUsernameAndPassword(username string, password string) bool
func (*BasicAuthManager) VerifyUsernameAndPasswordBytes ¶
func (b *BasicAuthManager) VerifyUsernameAndPasswordBytes(username string, passwordBytes []byte) bool
Click to show internal directories.
Click to hide internal directories.