database

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const SecretCredsType = "creds"

Variables

This section is empty.

Functions

func Backend

func Backend(conf *logical.BackendConfig) *databaseBackend

func Factory

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

func New added in v1.6.4

func New() (interface{}, error)

New returns a new in-memory instance

func NewV4 added in v1.6.4

func NewV4() (interface{}, error)

New returns a new in-memory instance

func RunV4 added in v1.6.4

func RunV4(apiTLSConfig *api.TLSConfig) error

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

func RunV5 added in v1.6.4

func RunV5() error

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

Types

type DatabaseConfig

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 `` /* 136-byte string literal not displayed */

	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 added in v1.6.4

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

MockDatabaseV4 is an implementation of Database interface

func (MockDatabaseV4) Close added in v1.6.4

func (m MockDatabaseV4) Close() error

func (MockDatabaseV4) CreateUser added in v1.6.4

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 added in v1.6.4

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

func (MockDatabaseV4) Init added in v1.6.4

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

func (MockDatabaseV4) Initialize added in v1.6.4

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

func (MockDatabaseV4) RenewUser added in v1.6.4

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

func (MockDatabaseV4) RevokeUser added in v1.6.4

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

func (MockDatabaseV4) RotateRootCredentials added in v1.6.4

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

func (MockDatabaseV4) SetCredentials added in v1.6.4

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

func (MockDatabaseV4) Type added in v1.6.4

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

type MockDatabaseV5 added in v1.6.4

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

MockDatabaseV5 is an implementation of Database interface

func (MockDatabaseV5) Close added in v1.6.4

func (m MockDatabaseV5) Close() error

func (MockDatabaseV5) DeleteUser added in v1.6.4

func (MockDatabaseV5) Initialize added in v1.6.4

func (MockDatabaseV5) NewUser added in v1.6.4

func (MockDatabaseV5) Type added in v1.6.4

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

func (MockDatabaseV5) UpdateUser added in v1.6.4

Jump to

Keyboard shortcuts

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