auth

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedMech = errors.New("Unsupported SASL mechanism")
	ErrInvalidAuthCred = errors.New("auth: invalid credentials")
)

Functions

func CheckDomainAuth

func CheckDomainAuth(username string, perDomain bool, allowedDomains []string) (loginName string, allowed bool)

Types

type FailingSASLServ added in v0.2.0

type FailingSASLServ struct{ Err error }

func (FailingSASLServ) Next added in v0.2.0

func (s FailingSASLServ) Next([]byte) ([]byte, bool, error)

type SASLAuth added in v0.2.0

type SASLAuth struct {
	Log         log.Logger
	OnlyFirstID bool

	AuthMap       module.Table
	AuthNormalize authz.NormalizeFunc

	Plain []module.PlainAuth
}

SASLAuth is a wrapper that initializes sasl.Server using authenticators that call maddy module objects.

It also handles username translation using auth_map and auth_map_normalize (AuthMap and AuthMapNormalize should be set).

It supports reporting of multiple authorization identities so multiple accounts can be associated with a single set of credentials.

func (*SASLAuth) AddProvider added in v0.2.0

func (s *SASLAuth) AddProvider(m *config.Map, node config.Node) error

AddProvider adds the SASL authentication provider to its mapping by parsing the 'auth' configuration directive.

func (*SASLAuth) AuthPlain added in v0.2.0

func (s *SASLAuth) AuthPlain(username, password string) error

func (*SASLAuth) CreateSASL added in v0.2.0

func (s *SASLAuth) CreateSASL(mech string, remoteAddr net.Addr, successCb func(identity string) error) sasl.Server

CreateSASL creates the sasl.Server instance for the corresponding mechanism.

func (*SASLAuth) SASLMechanisms added in v0.2.0

func (s *SASLAuth) SASLMechanisms() []string

Directories

Path Synopsis
shadow package implements utilities for parsing and using shadow password database on Unix systems.
shadow package implements utilities for parsing and using shadow password database on Unix systems.

Jump to

Keyboard shortcuts

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