vault: github.com/hashicorp/vault/builtin/logical/database Index | Files

package database

import "github.com/hashicorp/vault/builtin/logical/database"

Index

Package Files

backend.go mockv4.go mockv5.go path_config_connection.go path_creds_create.go path_roles.go path_rotate_credentials.go rollback.go rotation.go secret_creds.go version_wrapper.go

Constants

const SecretCredsType = "creds"

func Backend Uses

func Backend(conf *logical.BackendConfig) *databaseBackend

func Factory Uses

func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

func New Uses

func New() (interface{}, error)

New returns a new in-memory instance

func NewV4 Uses

func NewV4() (interface{}, error)

New returns a new in-memory instance

func RunV4 Uses

func RunV4(apiTLSConfig *api.TLSConfig) error

RunV4 instantiates a MongoDB object, and runs the RPC server for the plugin

func RunV5 Uses

func RunV5() error

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

type DatabaseConfig Uses

type DatabaseConfig struct {
    PluginName string `json:"plugin_name" structs:"plugin_name" mapstructure:"plugin_name"`
    // ConnectionDetails stores the database specific connection settings needed
    // by each database type.
    ConnectionDetails map[string]interface{} `json:"connection_details" structs:"connection_details" mapstructure:"connection_details"`
    AllowedRoles      []string               `json:"allowed_roles" structs:"allowed_roles" mapstructure:"allowed_roles"`

    RootCredentialsRotateStatements []string `json:"root_credentials_rotate_statements" structs:"root_credentials_rotate_statements" mapstructure:"root_credentials_rotate_statements"`

    PasswordPolicy string `json:"password_policy" structs:"password_policy" mapstructure:"password_policy"`
}

DatabaseConfig is used by the Factory function to configure a Database object.

type MockDatabaseV4 Uses

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

MockDatabaseV4 is an implementation of Database interface

func (MockDatabaseV4) Close Uses

func (m MockDatabaseV4) Close() error

func (MockDatabaseV4) CreateUser Uses

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

func (MockDatabaseV4) GenerateCredentials Uses

func (m MockDatabaseV4) GenerateCredentials(ctx context.Context) (password string, err error)

func (MockDatabaseV4) Init Uses

func (m MockDatabaseV4) Init(ctx context.Context, config map[string]interface{}, verifyConnection bool) (saveConfig map[string]interface{}, err error)

func (MockDatabaseV4) Initialize Uses

func (m MockDatabaseV4) Initialize(ctx context.Context, config map[string]interface{}, verifyConnection bool) (err error)

func (MockDatabaseV4) RenewUser Uses

func (m MockDatabaseV4) RenewUser(ctx context.Context, statements v4.Statements, username string, expiration time.Time) error

func (MockDatabaseV4) RevokeUser Uses

func (m MockDatabaseV4) RevokeUser(ctx context.Context, statements v4.Statements, username string) error

func (MockDatabaseV4) RotateRootCredentials Uses

func (m MockDatabaseV4) RotateRootCredentials(ctx context.Context, statements []string) (config map[string]interface{}, err error)

func (MockDatabaseV4) SetCredentials Uses

func (m MockDatabaseV4) SetCredentials(ctx context.Context, statements v4.Statements, staticConfig v4.StaticUserConfig) (username string, password string, err error)

func (MockDatabaseV4) Type Uses

func (m MockDatabaseV4) Type() (string, error)

type MockDatabaseV5 Uses

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

MockDatabaseV5 is an implementation of Database interface

func (MockDatabaseV5) Close Uses

func (m MockDatabaseV5) Close() error

func (MockDatabaseV5) DeleteUser Uses

func (m MockDatabaseV5) DeleteUser(ctx context.Context, req v5.DeleteUserRequest) (v5.DeleteUserResponse, error)

func (MockDatabaseV5) Initialize Uses

func (m MockDatabaseV5) Initialize(ctx context.Context, req v5.InitializeRequest) (v5.InitializeResponse, error)

func (MockDatabaseV5) NewUser Uses

func (m MockDatabaseV5) NewUser(ctx context.Context, req v5.NewUserRequest) (v5.NewUserResponse, error)

func (MockDatabaseV5) Type Uses

func (m MockDatabaseV5) Type() (string, error)

func (MockDatabaseV5) UpdateUser Uses

func (m MockDatabaseV5) UpdateUser(ctx context.Context, req v5.UpdateUserRequest) (v5.UpdateUserResponse, error)

Package database imports 30 packages (graph) and is imported by 11 packages. Updated 2020-12-03. Refresh now. Tools for package owners.