pam

package
v1.21.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	ServiceName    string // pam service (e.g. system-auth)
	EmailDomain    string
	SkipLocalTwoFA bool `json:",omitempty"` // Skip Local 2fa for users authenticated with this source
	// contains filtered or unexported fields
}

Source holds configuration for the PAM login source.

func (*Source) Authenticate

func (source *Source) Authenticate(ctx context.Context, user *user_model.User, userName, password string) (*user_model.User, error)

Authenticate queries if login/password is valid against the PAM, and create a local user if success when enabled.

func (*Source) FromDB

func (source *Source) FromDB(bs []byte) error

FromDB fills up a PAMConfig from serialized format.

func (*Source) IsSkipLocalTwoFA

func (source *Source) IsSkipLocalTwoFA() bool

IsSkipLocalTwoFA returns if this source should skip local 2fa for password authentication

func (*Source) SetAuthSource

func (source *Source) SetAuthSource(authSource *auth.Source)

SetAuthSource sets the related AuthSource

func (*Source) ToDB

func (source *Source) ToDB() ([]byte, error)

ToDB exports a PAMConfig to a serialized format.

Jump to

Keyboard shortcuts

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