v2

package
v0.0.0-...-809d1b6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EveryLogin  TwoFactorCodeDuration = 0
	Every30Days                       = 30
	Forever                           = 99999
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Ui() AuthUI
	SettingsStorage() auth2.ISettingsStorage
	Endpoint() auth2.KeeperEndpoint
	AuthContext() *AuthContext
	IsAuthenticated() bool
	Login(string, string) error
	Logout()
	ExecuteAuthCommand(interface{}, interface{}, bool) error
}

func NewAuth

func NewAuth(ui AuthUI, settings auth2.ISettingsStorage) Auth

type AuthContext

type AuthContext struct {
	Username          string
	DataKey           []byte
	ClientKey         []byte
	PrivateKey        crypto.PrivateKey
	IsEnterpriseAdmin bool
	SessionToken      string
	Settings          *auth2.AccountSettings
	Enforcements      *auth2.AccountEnforcements
	// contains filtered or unexported fields
}

type AuthUI

type AuthUI interface {
	Confirmation(information string) bool
	GetNewPassword(matcher PasswordRuleMatcher) string
	GetTwoFactorCode(channel TwoFactorChannel) (string, TwoFactorCodeDuration)
}

type PasswordRuleMatcher

type PasswordRuleMatcher interface {
	GetRuleIntro() string
	MatchFailedRules(password string) []string
}

type TwoFactorChannel

type TwoFactorChannel int
const (
	Authenticator TwoFactorChannel = iota
	TextMessage
	DuoSecurity
	Other
)

func (TwoFactorChannel) String

func (channel TwoFactorChannel) String() string

type TwoFactorCodeDuration

type TwoFactorCodeDuration int32

func (TwoFactorCodeDuration) String

func (duration TwoFactorCodeDuration) String() string

Jump to

Keyboard shortcuts

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