usercli

package
v0.0.0-...-391d5ce Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPasswordsDoNotMatch = errors.New("passwords do not match")

Functions

func CreateUser

func CreateUser(userService UserService, pr PasswordReader, username string, groups []string, twoFASendTo string) error

func DeleteUser

func DeleteUser(userService UserService, username string) error

func UpdateUser

func UpdateUser(userService UserService, pr PasswordReader, username string, groups []string, twoFASendTo string, askForPassword bool) error

Types

type PasswordReader

type PasswordReader interface {
	ReadPassword() (string, error)
}

func NewPasswordReader

func NewPasswordReader() PasswordReader

type UserInput

type UserInput struct {
	Username    string
	Password    string
	Groups      []string
	TwoFASendTo string
}

type UserService

type UserService interface {
	Create(input UserInput) error
	Change(input UserInput) error
	Delete(username string) error
	ProviderType() enums.ProviderSource
}

func NewUserService

func NewUserService(cfg *chconfig.Config) (UserService, error)

Jump to

Keyboard shortcuts

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