command

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PasswordAuthenticator

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

func New

func New(command string, args []string, logger log.Logger) (
	*PasswordAuthenticator, error)

New creates a new PasswordAuthenticator. The command used to authenticate the user is command and args may contain optional arguments to pass after the username. Log messages are written to logger. A new *PasswordAuthenticator is returned if the command exists, else an error is returned. The command should exit with 0 for a successful authentication, 1 if the authentication is not successful (bad username/password) and any other value if an error occurs.

func (*PasswordAuthenticator) PasswordAuthenticate

func (pa *PasswordAuthenticator) PasswordAuthenticate(username string,
	password []byte) (bool, error)

PasswordAuthenticate will authenticate a user using the provided username and password. The password is provided on the standard input of the authentication command. It returns true if the user is authenticated, else false (due to either invalid username or incorrect password), and an error.

func (*PasswordAuthenticator) UpdateStorage added in v1.4.6

func (pa *PasswordAuthenticator) UpdateStorage(storage simplestorage.SimpleStore) error

Jump to

Keyboard shortcuts

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