users

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Root         = "root"
	Operator     = "operator"
	Monitor      = "monitor"
	Xtrabackup   = "xtrabackup"
	Replication  = "replication"
	ProxyAdmin   = "proxyadmin"
	PMMServer    = "pmmserver"
	PMMServerKey = "pmmserverkey"
)

Variables

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(addr string, user, pass string, timeout int32) (Manager, error)

func (*Manager) Close

func (u *Manager) Close() error

func (*Manager) CreateOperatorUser

func (u *Manager) CreateOperatorUser(pass string) error

func (*Manager) CreateReplicationUser added in v1.9.0

func (u *Manager) CreateReplicationUser(password string) error

func (*Manager) DiscardOldPassword added in v1.12.0

func (m *Manager) DiscardOldPassword(user *SysUser) error

DiscardOldPassword discards old passwords of given users

func (*Manager) GetUser added in v1.16.0

func (p *Manager) GetUser(ctx context.Context, user string) (*User, error)

GetUsers returns a user stored in the database

func (*Manager) IsOldPassDiscarded added in v1.12.0

func (m *Manager) IsOldPassDiscarded(user *SysUser) (bool, error)

DiscardOldPassword discards old passwords of given users

func (*Manager) Update1100MonitorUserPrivilege added in v1.14.0

func (u *Manager) Update1100MonitorUserPrivilege() (err error)

Update1100MonitorUserPrivilege grants system_user privilege for monitor

func (*Manager) Update1150XtrabackupUser added in v1.15.0

func (u *Manager) Update1150XtrabackupUser(pass string) (err error)

Update1150XtrabackupUser grants all needed rights to the xtrabackup user

func (*Manager) Update160MonitorUserGrant added in v1.6.0

func (u *Manager) Update160MonitorUserGrant(pass string) (err error)

Update160MonitorUserGrant grants SERVICE_CONNECTION_ADMIN rights to the monitor user if pxc version is 8 or more and sets the MAX_USER_CONNECTIONS parameter to 100 (empirically determined)

func (*Manager) UpdatePassExpirationPolicy added in v1.13.0

func (u *Manager) UpdatePassExpirationPolicy(user *SysUser) error

UpdatePassExpirationPolicy sets user password expiration policy to never

func (*Manager) UpdateProxyUser added in v1.12.0

func (u *Manager) UpdateProxyUser(user *SysUser) error

func (*Manager) UpdateUserPass added in v1.12.0

func (m *Manager) UpdateUserPass(user *SysUser) error

UpdateUserPass updates user passwords but retains the current password using Dual Password feature of MySQL 8.

func (*Manager) UpdateUserPassWithoutDP added in v1.12.0

func (u *Manager) UpdateUserPassWithoutDP(user *SysUser) error

UpdateUserPassWithoutDP updates user pass without Dual Password feature introduced in MsSQL 8

func (*Manager) UpsertUser added in v1.16.0

func (u *Manager) UpsertUser(ctx context.Context, query []string, pass string) error

type SysUser

type SysUser struct {
	Name  string   `yaml:"username"`
	Pass  string   `yaml:"password"`
	Hosts []string `yaml:"hosts"`
}

type User added in v1.16.0

type User struct {
	Name  string
	Hosts sets.Set[string]
	DBs   sets.Set[string]

	// Grants holds the grants for each user@host
	Grants map[string][]string
}

Jump to

Keyboard shortcuts

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