auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxConcurrentRemoteUpgrades = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Authenticate(username, password string) error
}

func NewBackend

func NewBackend(conf *Config, infoLog, dbgLog *log.Logger) (Backend, error)

func NewLDAPBackend

func NewLDAPBackend(conf *LDAPConfig, infoLog, dbgLog *log.Logger) (Backend, error)

func NewStaticBackend

func NewStaticBackend(conf *StaticConfig, infoLog, dbgLog *log.Logger) (Backend, error)

func NewWhawtyAuthBackend

func NewWhawtyAuthBackend(conf *WhawtyAuthConfig, infoLog, dbgLog *log.Logger) (Backend, error)

type Config

type Config struct {
	LDAP   *LDAPConfig       `yaml:"ldap"`
	Static *StaticConfig     `yaml:"static"`
	Whawty *WhawtyAuthConfig `yaml:"whawty"`
}

type LDAPBackend

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

func (*LDAPBackend) Authenticate

func (b *LDAPBackend) Authenticate(username, password string) (err error)

type LDAPConfig

type LDAPConfig struct {
	Servers          []string         `yaml:"servers"`
	RootDN           string           `yaml:"root-dn"`
	ManagerDN        string           `yaml:"manager-dn"`
	ManagerPassword  string           `yaml:"manager-password"`
	UserSearchBase   string           `yaml:"user-search-base"`
	UserSearchFilter string           `yaml:"user-search-filter"`
	UserDNTemplate   string           `yaml:"user-dn-template"`
	TLS              *TLSClientConfig `yaml:"tls"`
}

type NullBackend

type NullBackend struct {
}

func (*NullBackend) Authenticate

func (b *NullBackend) Authenticate(username, password string) error

type StaticBackend

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

func (*StaticBackend) Authenticate

func (b *StaticBackend) Authenticate(username, password string) error

type StaticConfig

type StaticConfig struct {
	HTPasswd   string `yaml:"htpasswd"`
	AutoReload bool   `yaml:"autoreload"`
}

type TLSClientConfig

type TLSClientConfig struct {
	StartTLS           bool     `yaml:"start-tls"`
	InsecureSkipVerify bool     `yaml:"insecure-skip-verify"`
	CACertificates     string   `yaml:"ca-certificates"`
	CACertificateFiles []string `yaml:"ca-certificate-files"`
}

func (TLSClientConfig) ToGoTLSConfig

func (t TLSClientConfig) ToGoTLSConfig() (*tls.Config, error)

type WhawtyAuthBackend

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

func (*WhawtyAuthBackend) Authenticate

func (b *WhawtyAuthBackend) Authenticate(username, password string) error

type WhawtyAuthConfig

type WhawtyAuthConfig struct {
	ConfigFile     string `yaml:"store"`
	AutoReload     bool   `yaml:"autoreload"`
	RemoteUpgrades *struct {
		URL string           `yaml:"url"`
		TLS *TLSClientConfig `yaml:"tls"`
	} `yaml:"remote-upgrades"`
}

Jump to

Keyboard shortcuts

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