Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuthProvider ¶
type BasicAuthProvider struct { CredentialMap map[string]string PasswordService auth.IPasswordService }
BasicAuthProvider offers in interface for authenticating users with basic user name and password. These credentials are stored in the config file. They are hashed for security reasons.
func (*BasicAuthProvider) Login ¶
func (p *BasicAuthProvider) Login(credentials *auth.AuthCredentials) error
Login returns an error if the credential provided are invalid
type MockPasswordService ¶
func (*MockPasswordService) IsPasswordValid ¶
func (m *MockPasswordService) IsPasswordValid(password, storedPassword []byte) bool
type PasswordService ¶
type PasswordService struct{}
PasswordService provides methods for working with passwords
func (*PasswordService) HashPassword ¶
func (s *PasswordService) HashPassword(password []byte) ([]byte, error)
HashPassword hashes a password
func (*PasswordService) IsPasswordValid ¶
func (s *PasswordService) IsPasswordValid(password, storedPassword []byte) bool
IsPasswordValid returns true if the provided password matches the stored password
Click to show internal directories.
Click to hide internal directories.