auth

package
v0.0.0-...-ec5e93e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextKeyUser              = "CONTEXT_USER"
	ContextKeyClient            = "CONTEXT_CLIENT"
	ContextKeyDirectLoginFormat = "CONTEXT_DIRECT_LOGIN_FORMAT"
)
View Source
const (
	AuthFailed = iota
	AuthBlock
	AuthSuccess
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfirmOption

type ConfirmOption func(*connectionConfirmOption)

func ConfirmWithAssetID

func ConfirmWithAssetID(AssetId string) ConfirmOption

func ConfirmWithAssetName

func ConfirmWithAssetName(AssetName string) ConfirmOption

func ConfirmWithSystemUser

func ConfirmWithSystemUser(sysUser *model.SystemUser) ConfirmOption

func ConfirmWithUser

func ConfirmWithUser(user *model.User) ConfirmOption

type LoginConfirmService

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

func NewLoginConfirm

func NewLoginConfirm(core *core.Core, opts ...ConfirmOption) LoginConfirmService

func (*LoginConfirmService) CheckIsNeedLoginConfirm

func (c *LoginConfirmService) CheckIsNeedLoginConfirm() (bool, error)

func (*LoginConfirmService) GetApprover

func (c *LoginConfirmService) GetApprover() string

func (*LoginConfirmService) GetReviewers

func (c *LoginConfirmService) GetReviewers() []string

func (*LoginConfirmService) GetTicketId

func (c *LoginConfirmService) GetTicketId() string

func (*LoginConfirmService) WaitLoginConfirm

func (c *LoginConfirmService) WaitLoginConfirm(ctx context.Context) Status

type SSHAuthFunc

type SSHAuthFunc func(ctx ssh.Context, password, publicKey string) bool

func SSHPasswordAndPublicKeyAuth

func SSHPasswordAndPublicKeyAuth(c *core.Core) SSHAuthFunc

type Status

type Status int
const (
	StatusApprove Status = iota + 1
	StatusReject
	StatusCancel
)

type UserAuthClient

type UserAuthClient struct {
	*core.Core
	model.UserClient
}

func (*UserAuthClient) Authenticate

func (u *UserAuthClient) Authenticate(username string) (model.User, int)

func (*UserAuthClient) SetOption

func (u *UserAuthClient) SetOption(setters ...model.UserClientOption)

Jump to

Keyboard shortcuts

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