vault: Index | Files | Directories

package mysql

import ""


Package Files



var (
    MetadataLen       int = 10
    LegacyMetadataLen int = 4
    UsernameLen       int = 32
    LegacyUsernameLen int = 16

func New Uses

func New(displayNameLen, roleNameLen, usernameLen int) func() (interface{}, error)

New implements builtinplugins.BuiltinFactory

func Run Uses

func Run(apiTLSConfig *api.TLSConfig) error

Run instantiates a MySQL object, and runs the RPC server for the plugin

func RunLegacy Uses

func RunLegacy(apiTLSConfig *api.TLSConfig) error

Run instantiates a MySQL object, and runs the RPC server for the plugin

type MySQL Uses

type MySQL struct {

func (*MySQL) CreateUser Uses

func (m *MySQL) CreateUser(ctx context.Context, statements dbplugin.Statements, usernameConfig dbplugin.UsernameConfig, expiration time.Time) (username string, password string, err error)

func (*MySQL) RenewUser Uses

func (m *MySQL) RenewUser(ctx context.Context, statements dbplugin.Statements, username string, expiration time.Time) error


func (*MySQL) RevokeUser Uses

func (m *MySQL) RevokeUser(ctx context.Context, statements dbplugin.Statements, username string) error

func (*MySQL) RotateRootCredentials Uses

func (m *MySQL) RotateRootCredentials(ctx context.Context, statements []string) (map[string]interface{}, error)

func (*MySQL) SetCredentials Uses

func (m *MySQL) SetCredentials(ctx context.Context, statements dbplugin.Statements, staticUser dbplugin.StaticUserConfig) (username, password string, err error)

SetCredentials uses provided information to set the password to a user in the database. Unlike CreateUser, this method requires a username be provided and uses the name given, instead of generating a name. This is used for setting the password of static accounts, as well as rolling back passwords in the database in the event an updated database fails to save in Vault's storage.

func (*MySQL) Type Uses

func (m *MySQL) Type() (string, error)



Package mysql imports 12 packages (graph) and is imported by 7 packages. Updated 2019-07-08. Refresh now. Tools for package owners.