db

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

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

Authenticate authenticates the provided user against the DB

Types

type ErrUserPasswordInvalid added in v1.20.0

type ErrUserPasswordInvalid struct {
	UID  int64
	Name string
}

ErrUserPasswordInvalid represents a "ErrUserPasswordInvalid" kind of error.

func (ErrUserPasswordInvalid) Error added in v1.20.0

func (err ErrUserPasswordInvalid) Error() string

func (ErrUserPasswordInvalid) Unwrap added in v1.20.0

func (err ErrUserPasswordInvalid) Unwrap() error

Unwrap unwraps this error as a ErrInvalidArgument error

type ErrUserPasswordNotSet added in v1.20.0

type ErrUserPasswordNotSet struct {
	UID  int64
	Name string
}

ErrUserPasswordNotSet represents a "ErrUserPasswordNotSet" kind of error.

func (ErrUserPasswordNotSet) Error added in v1.20.0

func (err ErrUserPasswordNotSet) Error() string

func (ErrUserPasswordNotSet) Unwrap added in v1.20.0

func (err ErrUserPasswordNotSet) Unwrap() error

Unwrap unwraps this error as a ErrInvalidArgument error

type Source

type Source struct{}

Source is a password authentication service

func (*Source) Authenticate

func (source *Source) Authenticate(ctx context.Context, user *user_model.User, login, 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 an OAuth2Config from serialized format.

func (*Source) ToDB

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

ToDB exports an SMTPConfig to a serialized format.

Jump to

Keyboard shortcuts

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