Versions in this module Expand all Collapse all v0 v0.8.0 Dec 30, 2020 Changes in this version + var AllPermissions = ReadPerm | WritePerm + var DefaultPermissions = ReadPerm + var ErrDuplicateUser = errors.NewKind("duplicate user, %s") + var ErrNoPermission = errors.NewKind("user does not have permission: %s") + var ErrNotAuthorized = errors.NewKind("not authorized") + var ErrParseUserFile = errors.NewKind("error parsing user file") + var ErrUnknownPermission = errors.NewKind("unknown permission, %s") + var PermissionNames = map[string]Permission + func NativePassword(password string) string + type Audit struct + func (a *Audit) Allowed(ctx *sql.Context, permission Permission) error + func (a *Audit) Mysql() mysql.AuthServer + func (a *Audit) Query(ctx *sql.Context, d time.Duration, err error) + type AuditLog struct + func (a *AuditLog) Authentication(user string, address string, err error) + func (a *AuditLog) Authorization(ctx *sql.Context, p Permission, err error) + func (a *AuditLog) Query(ctx *sql.Context, d time.Duration, err error) + type AuditMethod interface + Authentication func(user, address string, err error) + Authorization func(ctx *sql.Context, p Permission, err error) + Query func(ctx *sql.Context, d time.Duration, err error) + func NewAuditLog(l *logrus.Logger) AuditMethod + type Auth interface + Allowed func(ctx *sql.Context, permission Permission) error + Mysql func() mysql.AuthServer + func NewAudit(auth Auth, method AuditMethod) Auth + type MysqlAudit struct + func (m *MysqlAudit) ValidateHash(salt []byte, user string, resp []byte, addr net.Addr) (mysql.Getter, error) + type Native struct + func NewNativeFile(file string) (*Native, error) + func NewNativeSingle(name, password string, perm Permission) *Native + func (s *Native) Allowed(ctx *sql.Context, permission Permission) error + func (s *Native) Mysql() mysql.AuthServer + type None struct + func (n *None) Allowed(ctx *sql.Context, permission Permission) error + func (n *None) Mysql() mysql.AuthServer + type Permission int + const ReadPerm + const WritePerm + func (p Permission) String() string