database

package
v0.0.0-...-a0f6db5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MPL-2.0 Imports: 38 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

func New() (interface{}, error)

New returns a new in-memory instance

func NewV4

func NewV4() (interface{}, error)

New returns a new in-memory instance

func RunV4

func RunV4(apiTLSConfig *api.TLSConfig) error

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

func RunV5

func RunV5() error

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

func RunV6Multiplexed

func RunV6Multiplexed() 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"`
	PluginVersion string `json:"plugin_version" structs:"plugin_version" mapstructure:"plugin_version"`
	// 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.

func (*DatabaseConfig) SupportsCredentialType

func (c *DatabaseConfig) SupportsCredentialType(credentialType v5.CredentialType) bool

type MockDatabaseV4

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

MockDatabaseV4 is an implementation of Database interface

func (MockDatabaseV4) Close

func (m MockDatabaseV4) Close() error

func (MockDatabaseV4) CreateUser

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

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

func (MockDatabaseV4) Init

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

func (MockDatabaseV4) Initialize

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

func (MockDatabaseV4) RenewUser

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

func (MockDatabaseV4) RevokeUser

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

func (MockDatabaseV4) RotateRootCredentials

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

func (MockDatabaseV4) SetCredentials

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

func (MockDatabaseV4) Type

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

type MockDatabaseV5

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

MockDatabaseV5 is an implementation of Database interface

func (MockDatabaseV5) Close

func (m MockDatabaseV5) Close() error

func (MockDatabaseV5) DeleteUser

func (MockDatabaseV5) Initialize

func (MockDatabaseV5) NewUser

func (MockDatabaseV5) Type

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

func (MockDatabaseV5) UpdateUser

Jump to

Keyboard shortcuts

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