auth

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandAuthenticator

type CommandAuthenticator struct {
	Cmd string
}

func (*CommandAuthenticator) Authenticate

func (a *CommandAuthenticator) Authenticate(addr net.Addr, auth string, tx uint64) (ok bool, id string)

type HTTPAuthenticator

type HTTPAuthenticator struct {
	Client *http.Client
	URL    string
}

func NewHTTPAuthenticator

func NewHTTPAuthenticator(url string, insecure bool) *HTTPAuthenticator

func (*HTTPAuthenticator) Authenticate

func (a *HTTPAuthenticator) Authenticate(addr net.Addr, auth string, tx uint64) (ok bool, id string)

type PasswordAuthenticator

type PasswordAuthenticator struct {
	Password string
}

PasswordAuthenticator is a simple authenticator that checks the password against a single string.

func (*PasswordAuthenticator) Authenticate

func (a *PasswordAuthenticator) Authenticate(addr net.Addr, auth string, tx uint64) (ok bool, id string)

type UserPassAuthenticator

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

UserPassAuthenticator checks the provided auth string against a map of username/password pairs. The format of the auth string must be "username:password".

func NewUserPassAuthenticator

func NewUserPassAuthenticator(users map[string]string) *UserPassAuthenticator

func (*UserPassAuthenticator) Authenticate

func (a *UserPassAuthenticator) Authenticate(addr net.Addr, auth string, tx uint64) (ok bool, id string)

Jump to

Keyboard shortcuts

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