dbplugin

package
v0.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package dbplugin is a generated protocol buffer package.

It is generated from these files:

builtin/logical/database/dbplugin/database.proto

It has these top-level messages:

InitializeRequest
InitRequest
CreateUserRequest
RenewUserRequest
RevokeUserRequest
RotateRootCredentialsRequest
Statements
UsernameConfig
InitResponse
CreateUserResponse
TypeResponse
RotateRootCredentialsResponse
Empty

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPluginShutdown = errors.New("plugin shutdown")
)

Functions

func RegisterDatabaseServer added in v0.9.1

func RegisterDatabaseServer(s *grpc.Server, srv DatabaseServer)

func Serve

func Serve(db Database, tlsProvider func() (*tls.Config, error))

Serve is called from within a plugin and wraps the provided Database implementation in a databasePluginRPCServer object and starts a RPC server.

func ServeConfig added in v0.9.1

func ServeConfig(db Database, tlsProvider func() (*tls.Config, error)) *plugin.ServeConfig

Types

type CreateUserRequest

type CreateUserRequest struct {
	Statements     *Statements                `protobuf:"bytes,1,opt,name=statements" json:"statements,omitempty"`
	UsernameConfig *UsernameConfig            `protobuf:"bytes,2,opt,name=username_config,json=usernameConfig" json:"username_config,omitempty"`
	Expiration     *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=expiration" json:"expiration,omitempty"`
}

func (*CreateUserRequest) Descriptor added in v0.9.1

func (*CreateUserRequest) Descriptor() ([]byte, []int)

func (*CreateUserRequest) GetExpiration added in v0.9.1

func (m *CreateUserRequest) GetExpiration() *google_protobuf.Timestamp

func (*CreateUserRequest) GetStatements added in v0.9.1

func (m *CreateUserRequest) GetStatements() *Statements

func (*CreateUserRequest) GetUsernameConfig added in v0.9.1

func (m *CreateUserRequest) GetUsernameConfig() *UsernameConfig

func (*CreateUserRequest) ProtoMessage added in v0.9.1

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) Reset added in v0.9.1

func (m *CreateUserRequest) Reset()

func (*CreateUserRequest) String added in v0.9.1

func (m *CreateUserRequest) String() string

type CreateUserRequestRPC added in v0.9.1

type CreateUserRequestRPC struct {
	Statements     Statements
	UsernameConfig UsernameConfig
	Expiration     time.Time
}

type CreateUserResponse

type CreateUserResponse struct {
	Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
}

func (*CreateUserResponse) Descriptor added in v0.9.1

func (*CreateUserResponse) Descriptor() ([]byte, []int)

func (*CreateUserResponse) GetPassword added in v0.9.1

func (m *CreateUserResponse) GetPassword() string

func (*CreateUserResponse) GetUsername added in v0.9.1

func (m *CreateUserResponse) GetUsername() string

func (*CreateUserResponse) ProtoMessage added in v0.9.1

func (*CreateUserResponse) ProtoMessage()

func (*CreateUserResponse) Reset added in v0.9.1

func (m *CreateUserResponse) Reset()

func (*CreateUserResponse) String added in v0.9.1

func (m *CreateUserResponse) String() string

type Database

type Database interface {
	Type() (string, error)
	CreateUser(ctx context.Context, statements Statements, usernameConfig UsernameConfig, expiration time.Time) (username string, password string, err error)
	RenewUser(ctx context.Context, statements Statements, username string, expiration time.Time) error
	RevokeUser(ctx context.Context, statements Statements, username string) error

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

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

	// DEPRECATED, will be removed in 0.12
	Initialize(ctx context.Context, config map[string]interface{}, verifyConnection bool) (err error)
}

Database is the interface that all database objects must implement.

func PluginFactory

func PluginFactory(ctx context.Context, pluginName string, sys pluginutil.LookRunnerUtil, logger log.Logger) (Database, error)

PluginFactory is used to build plugin database types. It wraps the database object in a logging and metrics middleware.

type DatabaseClient added in v0.9.1

type DatabaseClient interface {
	Type(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TypeResponse, error)
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
	RenewUser(ctx context.Context, in *RenewUserRequest, opts ...grpc.CallOption) (*Empty, error)
	RevokeUser(ctx context.Context, in *RevokeUserRequest, opts ...grpc.CallOption) (*Empty, error)
	RotateRootCredentials(ctx context.Context, in *RotateRootCredentialsRequest, opts ...grpc.CallOption) (*RotateRootCredentialsResponse, error)
	Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*InitResponse, error)
	Close(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	Initialize(ctx context.Context, in *InitializeRequest, opts ...grpc.CallOption) (*Empty, error)
}

func NewDatabaseClient added in v0.9.1

func NewDatabaseClient(cc *grpc.ClientConn) DatabaseClient

type DatabaseErrorSanitizerMiddleware added in v0.10.0

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

DatabaseErrorSanitizerMiddleware wraps an implementation of Databases and sanitizes returned error messages

func NewDatabaseErrorSanitizerMiddleware added in v0.10.0

func NewDatabaseErrorSanitizerMiddleware(next Database, secretsFn func() map[string]interface{}) *DatabaseErrorSanitizerMiddleware

func (*DatabaseErrorSanitizerMiddleware) Close added in v0.10.0

func (mw *DatabaseErrorSanitizerMiddleware) Close() (err error)

func (*DatabaseErrorSanitizerMiddleware) CreateUser added in v0.10.0

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

func (*DatabaseErrorSanitizerMiddleware) Init added in v0.10.0

func (mw *DatabaseErrorSanitizerMiddleware) Init(ctx context.Context, conf map[string]interface{}, verifyConnection bool) (saveConf map[string]interface{}, err error)

func (*DatabaseErrorSanitizerMiddleware) Initialize added in v0.10.0

func (mw *DatabaseErrorSanitizerMiddleware) Initialize(ctx context.Context, conf map[string]interface{}, verifyConnection bool) error

func (*DatabaseErrorSanitizerMiddleware) RenewUser added in v0.10.0

func (mw *DatabaseErrorSanitizerMiddleware) RenewUser(ctx context.Context, statements Statements, username string, expiration time.Time) (err error)

func (*DatabaseErrorSanitizerMiddleware) RevokeUser added in v0.10.0

func (mw *DatabaseErrorSanitizerMiddleware) RevokeUser(ctx context.Context, statements Statements, username string) (err error)

func (*DatabaseErrorSanitizerMiddleware) RotateRootCredentials added in v0.10.0

func (mw *DatabaseErrorSanitizerMiddleware) RotateRootCredentials(ctx context.Context, statements []string) (conf map[string]interface{}, err error)

func (*DatabaseErrorSanitizerMiddleware) Type added in v0.10.0

type DatabasePlugin

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

DatabasePlugin implements go-plugin's Plugin interface. It has methods for retrieving a server and a client instance of the plugin.

func (DatabasePlugin) Client

func (DatabasePlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (DatabasePlugin) GRPCClient added in v0.9.1

func (DatabasePlugin) GRPCClient(doneCtx context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (DatabasePlugin) GRPCServer added in v0.9.1

func (d DatabasePlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error

func (DatabasePlugin) Server

func (d DatabasePlugin) Server(*plugin.MuxBroker) (interface{}, error)

type DatabasePluginClient

type DatabasePluginClient struct {
	sync.Mutex

	Database
	// contains filtered or unexported fields
}

DatabasePluginClient embeds a databasePluginRPCClient and wraps it's Close method to also call Kill() on the plugin.Client.

func (*DatabasePluginClient) Close

func (dc *DatabasePluginClient) Close() error

This wraps the Close call and ensures we both close the database connection and kill the plugin.

type Empty added in v0.9.1

type Empty struct {
}

func (*Empty) Descriptor added in v0.9.1

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage added in v0.9.1

func (*Empty) ProtoMessage()

func (*Empty) Reset added in v0.9.1

func (m *Empty) Reset()

func (*Empty) String added in v0.9.1

func (m *Empty) String() string

type InitRequest added in v0.10.0

type InitRequest struct {
	Config           []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	VerifyConnection bool   `protobuf:"varint,2,opt,name=verify_connection,json=verifyConnection" json:"verify_connection,omitempty"`
}

func (*InitRequest) Descriptor added in v0.10.0

func (*InitRequest) Descriptor() ([]byte, []int)

func (*InitRequest) GetConfig added in v0.10.0

func (m *InitRequest) GetConfig() []byte

func (*InitRequest) GetVerifyConnection added in v0.10.0

func (m *InitRequest) GetVerifyConnection() bool

func (*InitRequest) ProtoMessage added in v0.10.0

func (*InitRequest) ProtoMessage()

func (*InitRequest) Reset added in v0.10.0

func (m *InitRequest) Reset()

func (*InitRequest) String added in v0.10.0

func (m *InitRequest) String() string

type InitRequestRPC added in v0.10.0

type InitRequestRPC struct {
	Config           map[string]interface{}
	VerifyConnection bool
}

type InitResponse added in v0.10.0

type InitResponse struct {
	Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
}

func (*InitResponse) Descriptor added in v0.10.0

func (*InitResponse) Descriptor() ([]byte, []int)

func (*InitResponse) GetConfig added in v0.10.0

func (m *InitResponse) GetConfig() []byte

func (*InitResponse) ProtoMessage added in v0.10.0

func (*InitResponse) ProtoMessage()

func (*InitResponse) Reset added in v0.10.0

func (m *InitResponse) Reset()

func (*InitResponse) String added in v0.10.0

func (m *InitResponse) String() string

type InitializeRequest

type InitializeRequest struct {
	Config           []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	VerifyConnection bool   `protobuf:"varint,2,opt,name=verify_connection,json=verifyConnection" json:"verify_connection,omitempty"`
}

func (*InitializeRequest) Descriptor added in v0.9.1

func (*InitializeRequest) Descriptor() ([]byte, []int)

func (*InitializeRequest) GetConfig added in v0.9.1

func (m *InitializeRequest) GetConfig() []byte

func (*InitializeRequest) GetVerifyConnection added in v0.9.1

func (m *InitializeRequest) GetVerifyConnection() bool

func (*InitializeRequest) ProtoMessage added in v0.9.1

func (*InitializeRequest) ProtoMessage()

func (*InitializeRequest) Reset added in v0.9.1

func (m *InitializeRequest) Reset()

func (*InitializeRequest) String added in v0.9.1

func (m *InitializeRequest) String() string

type InitializeRequestRPC added in v0.9.1

type InitializeRequestRPC struct {
	Config           map[string]interface{}
	VerifyConnection bool
}

type RenewUserRequest

type RenewUserRequest struct {
	Statements *Statements                `protobuf:"bytes,1,opt,name=statements" json:"statements,omitempty"`
	Username   string                     `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
	Expiration *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=expiration" json:"expiration,omitempty"`
}

func (*RenewUserRequest) Descriptor added in v0.9.1

func (*RenewUserRequest) Descriptor() ([]byte, []int)

func (*RenewUserRequest) GetExpiration added in v0.9.1

func (m *RenewUserRequest) GetExpiration() *google_protobuf.Timestamp

func (*RenewUserRequest) GetStatements added in v0.9.1

func (m *RenewUserRequest) GetStatements() *Statements

func (*RenewUserRequest) GetUsername added in v0.9.1

func (m *RenewUserRequest) GetUsername() string

func (*RenewUserRequest) ProtoMessage added in v0.9.1

func (*RenewUserRequest) ProtoMessage()

func (*RenewUserRequest) Reset added in v0.9.1

func (m *RenewUserRequest) Reset()

func (*RenewUserRequest) String added in v0.9.1

func (m *RenewUserRequest) String() string

type RenewUserRequestRPC added in v0.9.1

type RenewUserRequestRPC struct {
	Statements Statements
	Username   string
	Expiration time.Time
}

type RevokeUserRequest

type RevokeUserRequest struct {
	Statements *Statements `protobuf:"bytes,1,opt,name=statements" json:"statements,omitempty"`
	Username   string      `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
}

func (*RevokeUserRequest) Descriptor added in v0.9.1

func (*RevokeUserRequest) Descriptor() ([]byte, []int)

func (*RevokeUserRequest) GetStatements added in v0.9.1

func (m *RevokeUserRequest) GetStatements() *Statements

func (*RevokeUserRequest) GetUsername added in v0.9.1

func (m *RevokeUserRequest) GetUsername() string

func (*RevokeUserRequest) ProtoMessage added in v0.9.1

func (*RevokeUserRequest) ProtoMessage()

func (*RevokeUserRequest) Reset added in v0.9.1

func (m *RevokeUserRequest) Reset()

func (*RevokeUserRequest) String added in v0.9.1

func (m *RevokeUserRequest) String() string

type RevokeUserRequestRPC added in v0.9.1

type RevokeUserRequestRPC struct {
	Statements Statements
	Username   string
}

type RotateRootCredentialsRequest added in v0.10.0

type RotateRootCredentialsRequest struct {
	Statements []string `protobuf:"bytes,1,rep,name=statements" json:"statements,omitempty"`
}

func (*RotateRootCredentialsRequest) Descriptor added in v0.10.0

func (*RotateRootCredentialsRequest) Descriptor() ([]byte, []int)

func (*RotateRootCredentialsRequest) GetStatements added in v0.10.0

func (m *RotateRootCredentialsRequest) GetStatements() []string

func (*RotateRootCredentialsRequest) ProtoMessage added in v0.10.0

func (*RotateRootCredentialsRequest) ProtoMessage()

func (*RotateRootCredentialsRequest) Reset added in v0.10.0

func (m *RotateRootCredentialsRequest) Reset()

func (*RotateRootCredentialsRequest) String added in v0.10.0

type RotateRootCredentialsRequestRPC added in v0.10.0

type RotateRootCredentialsRequestRPC struct {
	Statements []string
}

type RotateRootCredentialsResponse added in v0.10.0

type RotateRootCredentialsResponse struct {
	Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
}

func (*RotateRootCredentialsResponse) Descriptor added in v0.10.0

func (*RotateRootCredentialsResponse) Descriptor() ([]byte, []int)

func (*RotateRootCredentialsResponse) GetConfig added in v0.10.0

func (m *RotateRootCredentialsResponse) GetConfig() []byte

func (*RotateRootCredentialsResponse) ProtoMessage added in v0.10.0

func (*RotateRootCredentialsResponse) ProtoMessage()

func (*RotateRootCredentialsResponse) Reset added in v0.10.0

func (m *RotateRootCredentialsResponse) Reset()

func (*RotateRootCredentialsResponse) String added in v0.10.0

type Statements

type Statements struct {
	// DEPRECATED, will be removed in 0.12
	CreationStatements string `protobuf:"bytes,1,opt,name=creation_statements,json=creationStatements" json:"creation_statements,omitempty"`
	// DEPRECATED, will be removed in 0.12
	RevocationStatements string `protobuf:"bytes,2,opt,name=revocation_statements,json=revocationStatements" json:"revocation_statements,omitempty"`
	// DEPRECATED, will be removed in 0.12
	RollbackStatements string `protobuf:"bytes,3,opt,name=rollback_statements,json=rollbackStatements" json:"rollback_statements,omitempty"`
	// DEPRECATED, will be removed in 0.12
	RenewStatements string   `protobuf:"bytes,4,opt,name=renew_statements,json=renewStatements" json:"renew_statements,omitempty"`
	Creation        []string `protobuf:"bytes,5,rep,name=creation" json:"creation,omitempty"`
	Revocation      []string `protobuf:"bytes,6,rep,name=revocation" json:"revocation,omitempty"`
	Rollback        []string `protobuf:"bytes,7,rep,name=rollback" json:"rollback,omitempty"`
	Renewal         []string `protobuf:"bytes,8,rep,name=renewal" json:"renewal,omitempty"`
}

func (*Statements) Descriptor added in v0.9.1

func (*Statements) Descriptor() ([]byte, []int)

func (*Statements) GetCreation added in v0.10.0

func (m *Statements) GetCreation() []string

func (*Statements) GetCreationStatements added in v0.9.1

func (m *Statements) GetCreationStatements() string

func (*Statements) GetRenewStatements added in v0.9.1

func (m *Statements) GetRenewStatements() string

func (*Statements) GetRenewal added in v0.10.0

func (m *Statements) GetRenewal() []string

func (*Statements) GetRevocation added in v0.10.0

func (m *Statements) GetRevocation() []string

func (*Statements) GetRevocationStatements added in v0.9.1

func (m *Statements) GetRevocationStatements() string

func (*Statements) GetRollback added in v0.10.0

func (m *Statements) GetRollback() []string

func (*Statements) GetRollbackStatements added in v0.9.1

func (m *Statements) GetRollbackStatements() string

func (*Statements) ProtoMessage added in v0.9.1

func (*Statements) ProtoMessage()

func (*Statements) Reset added in v0.9.1

func (m *Statements) Reset()

func (*Statements) String added in v0.9.1

func (m *Statements) String() string

type TypeResponse added in v0.9.1

type TypeResponse struct {
	Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
}

func (*TypeResponse) Descriptor added in v0.9.1

func (*TypeResponse) Descriptor() ([]byte, []int)

func (*TypeResponse) GetType added in v0.9.1

func (m *TypeResponse) GetType() string

func (*TypeResponse) ProtoMessage added in v0.9.1

func (*TypeResponse) ProtoMessage()

func (*TypeResponse) Reset added in v0.9.1

func (m *TypeResponse) Reset()

func (*TypeResponse) String added in v0.9.1

func (m *TypeResponse) String() string

type UsernameConfig added in v0.7.3

type UsernameConfig struct {
	DisplayName string `protobuf:"bytes,1,opt,name=DisplayName" json:"DisplayName,omitempty"`
	RoleName    string `protobuf:"bytes,2,opt,name=RoleName" json:"RoleName,omitempty"`
}

func (*UsernameConfig) Descriptor added in v0.9.1

func (*UsernameConfig) Descriptor() ([]byte, []int)

func (*UsernameConfig) GetDisplayName added in v0.9.1

func (m *UsernameConfig) GetDisplayName() string

func (*UsernameConfig) GetRoleName added in v0.9.1

func (m *UsernameConfig) GetRoleName() string

func (*UsernameConfig) ProtoMessage added in v0.9.1

func (*UsernameConfig) ProtoMessage()

func (*UsernameConfig) Reset added in v0.9.1

func (m *UsernameConfig) Reset()

func (*UsernameConfig) String added in v0.9.1

func (m *UsernameConfig) String() string

Jump to

Keyboard shortcuts

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