audit

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTrailHandler

func InitTrailHandler(enabled bool, handlerURL string) error

func IsSamePassword

func IsSamePassword(hashedPassword []byte, password string) bool

func MakePasswordError added in v1.4.0

func MakePasswordError(reason PasswordViolationReason, message string, info map[string]interface{}) skyerr.Error

func Trail

func Trail(entry Entry)

Types

type Entry

type Entry struct {
	Event         Event
	Admin         bool
	AuthID        string
	Data          map[string]interface{}
	RemoteAddr    string
	XForwardedFor string
	XRealIP       string
	Forwarded     string
}

func (Entry) WithRouterPayload

func (e Entry) WithRouterPayload(payload *router.Payload) Entry

type Event

type Event int
const (

	// EventLoginSuccess represents Login Success
	EventLoginSuccess Event

	// EventLoginFailure represents Login Failure
	EventLoginFailure

	// EventLogout represents Logout
	EventLogout

	// EventSignup represents Signup
	EventSignup

	// EventChangePassword represents Change Password
	EventChangePassword

	// EventChangeRoles represents Change Roles
	EventChangeRoles

	// EventResetPassword represents Reset Password
	EventResetPassword

	// EventDisableUser represents Disable User
	EventDisableUser

	// EventEnableUser represents Enable User
	EventEnableUser
)

func (Event) String

func (e Event) String() string

type PasswordChecker

type PasswordChecker struct {
	PwMinLength            int
	PwUppercaseRequired    bool
	PwLowercaseRequired    bool
	PwDigitRequired        bool
	PwSymbolRequired       bool
	PwMinGuessableLevel    int
	PwExcludedKeywords     []string
	PwExcludedFields       []string
	PwHistorySize          int
	PwHistoryDays          int
	PasswordHistoryEnabled bool
}

func (*PasswordChecker) ShouldSavePasswordHistory

func (pc *PasswordChecker) ShouldSavePasswordHistory() bool

func (*PasswordChecker) ValidatePassword

func (pc *PasswordChecker) ValidatePassword(payload ValidatePasswordPayload) skyerr.Error

type PasswordViolationReason added in v1.4.0

type PasswordViolationReason int

PasswordViolationReason is a detailed explanation of skyerr.PasswordPolicyViolated

const (
	// PasswordTooShort is self-explanatory
	PasswordTooShort PasswordViolationReason = iota
	// PasswordUppercaseRequired means the password does not contain ASCII uppercase character
	PasswordUppercaseRequired
	// PasswordLowercaseRequired means the password does not contain ASCII lowercase character
	PasswordLowercaseRequired
	// PasswordDigitRequired means the password does not contain ASCII digit character
	PasswordDigitRequired
	// PasswordSymbolRequired means the password does not contain ASCII non-alphanumeric character
	PasswordSymbolRequired
	// PasswordContainingExcludedKeywords means the password contains configured excluded keywords
	PasswordContainingExcludedKeywords
	// PasswordBelowGuessableLevel means the password's guessable level is below configured level.
	// The current implementation uses Dropbox's zxcvbn.
	PasswordBelowGuessableLevel
	// PasswordReused is self-explanatory
	PasswordReused
	// PasswordExpired is self-explanatory
	PasswordExpired
)

func (PasswordViolationReason) String added in v1.4.0

func (r PasswordViolationReason) String() string

type PwHousekeeper

type PwHousekeeper struct {
	AppName       string
	AccessControl string
	DBOpener      skydb.DBOpener
	DBImpl        string
	Option        string
	DBConfig      skydb.DBConfig

	PwHistorySize          int
	PwHistoryDays          int
	PasswordHistoryEnabled bool
}

func (*PwHousekeeper) Housekeep

func (p *PwHousekeeper) Housekeep(authID string)

type ValidatePasswordPayload

type ValidatePasswordPayload struct {
	AuthID        string
	PlainPassword string
	UserData      map[string]interface{}
	Conn          skydb.Conn
}

Jump to

Keyboard shortcuts

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