Documentation
¶
Overview ¶
Package mapauth implements the basic auth functionality using a user-pass-map.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAuthorizations = errors.New("no authorizations configured")
ErrNoAuthorizations is returned when no authorizations are configured.
View Source
var ErrNotInitialized = errors.New("mapauth not initialized")
ErrNotInitialized is returned when the map authenticator is not initialized.
Functions ¶
Types ¶
type MapAuthenticator ¶
type MapAuthenticator struct {
// contains filtered or unexported fields
}
MapAuthenticator holds the authentication relevant data.
func New ¶
func New(options ...func(a *MapAuthenticator) error) (*MapAuthenticator, error)
New creates a new MapAuthenticator with the given configuration.
func (*MapAuthenticator) Authenticate ¶
func (a *MapAuthenticator) Authenticate(username, password string) (bool, error)
Authenticate checks if a given username has the given password entry identical in the internal auths map.
Click to show internal directories.
Click to hide internal directories.