Documentation ¶
Index ¶
- Constants
- Variables
- func NewBackend(pluginName string, sys pluginutil.LookRunnerUtil, logger log.Logger, ...) (logical.Backend, error)
- func Serve(opts *ServeOpts) error
- type BackendFactoryFunc
- type BackendPlugin
- type BackendPluginClient
- func (b *BackendPluginClient) Cleanup()
- func (b BackendPluginClient) HandleExistenceCheck(req *logical.Request) (bool, bool, error)
- func (b BackendPluginClient) HandleRequest(req *logical.Request) (*logical.Response, error)
- func (b BackendPluginClient) Initialize() error
- func (b BackendPluginClient) InvalidateKey(key string)
- func (b BackendPluginClient) Logger() log.Logger
- func (b BackendPluginClient) RegisterLicense(license interface{}) error
- func (b BackendPluginClient) Setup(config *logical.BackendConfig) error
- func (b BackendPluginClient) SpecialPaths() *logical.Paths
- func (b BackendPluginClient) System() logical.SystemView
- func (b BackendPluginClient) Type() logical.BackendType
- type CachingDisabledReply
- type DefaultLeaseTTLReply
- type HandleExistenceCheckArgs
- type HandleExistenceCheckReply
- type HandleRequestArgs
- type HandleRequestReply
- type LoggerArgs
- type LoggerClient
- func (l *LoggerClient) Debug(msg string, args ...interface{})
- func (l *LoggerClient) Error(msg string, args ...interface{}) error
- func (l *LoggerClient) Fatal(msg string, args ...interface{})
- func (l *LoggerClient) Info(msg string, args ...interface{})
- func (l *LoggerClient) IsDebug() bool
- func (l *LoggerClient) IsInfo() bool
- func (l *LoggerClient) IsTrace() bool
- func (l *LoggerClient) IsWarn() bool
- func (l *LoggerClient) Log(level int, msg string, args []interface{})
- func (l *LoggerClient) SetLevel(level int)
- func (l *LoggerClient) Trace(msg string, args ...interface{})
- func (l *LoggerClient) Warn(msg string, args ...interface{}) error
- type LoggerReply
- type LoggerServer
- func (l *LoggerServer) Debug(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) Error(args *LoggerArgs, reply *LoggerReply) error
- func (l *LoggerServer) Info(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) IsDebug(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) IsInfo(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) IsTrace(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) IsWarn(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) Log(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) SetLevel(args int, _ *struct{}) error
- func (l *LoggerServer) Trace(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) Warn(args *LoggerArgs, reply *LoggerReply) error
- type MaxLeaseTTLReply
- type MlockEnabledReply
- type NOOPStorage
- type RegisterLicenseArgs
- type RegisterLicenseReply
- type ReplicationStateReply
- type ResponseWrapDataArgs
- type ResponseWrapDataReply
- type ServeOpts
- type SetupArgs
- type SetupReply
- type SpecialPathsReply
- type StorageClient
- type StorageDeleteReply
- type StorageGetReply
- type StorageListReply
- type StoragePutReply
- type StorageServer
- func (s *StorageServer) Delete(key string, reply *StorageDeleteReply) error
- func (s *StorageServer) Get(key string, reply *StorageGetReply) error
- func (s *StorageServer) List(prefix string, reply *StorageListReply) error
- func (s *StorageServer) Put(entry *logical.StorageEntry, reply *StoragePutReply) error
- type SudoPrivilegeArgs
- type SudoPrivilegeReply
- type SystemReply
- type SystemViewClient
- func (s *SystemViewClient) CachingDisabled() bool
- func (s *SystemViewClient) DefaultLeaseTTL() time.Duration
- func (s *SystemViewClient) LookupPlugin(name string) (*pluginutil.PluginRunner, error)
- func (s *SystemViewClient) MaxLeaseTTL() time.Duration
- func (s *SystemViewClient) MlockEnabled() bool
- func (s *SystemViewClient) ReplicationState() consts.ReplicationState
- func (s *SystemViewClient) ResponseWrapData(data map[string]interface{}, ttl time.Duration, jwt bool) (*wrapping.ResponseWrapInfo, error)
- func (s *SystemViewClient) SudoPrivilege(path string, token string) bool
- func (s *SystemViewClient) Tainted() bool
- type SystemViewServer
- func (s *SystemViewServer) CachingDisabled(_ interface{}, reply *CachingDisabledReply) error
- func (s *SystemViewServer) DefaultLeaseTTL(_ interface{}, reply *DefaultLeaseTTLReply) error
- func (s *SystemViewServer) MaxLeaseTTL(_ interface{}, reply *MaxLeaseTTLReply) error
- func (s *SystemViewServer) MlockEnabled(_ interface{}, reply *MlockEnabledReply) error
- func (s *SystemViewServer) ReplicationState(_ interface{}, reply *ReplicationStateReply) error
- func (s *SystemViewServer) ResponseWrapData(args *ResponseWrapDataArgs, reply *ResponseWrapDataReply) error
- func (s *SystemViewServer) SudoPrivilege(args *SudoPrivilegeArgs, reply *SudoPrivilegeReply) error
- func (s *SystemViewServer) Tainted(_ interface{}, reply *TaintedReply) error
- type TLSProdiverFunc
- type TaintedReply
- type TypeReply
Constants ¶
const BackendPluginName = "backend"
BackendPluginName is the name of the plugin that can be dispensed rom the plugin server.
Variables ¶
var (
ErrClientInMetadataMode = errors.New("plugin client can not perform action while in metadata mode")
)
var (
ErrServerInMetadataMode = errors.New("plugin server can not perform action while in metadata mode")
)
Functions ¶
func NewBackend ¶
func NewBackend(pluginName string, sys pluginutil.LookRunnerUtil, logger log.Logger, isMetadataMode bool) (logical.Backend, error)
NewBackend will return an instance of an RPC-based client implementation of the backend for external plugins, or a concrete implementation of the backend if it is a builtin backend. The backend is returned as a logical.Backend interface. The isMetadataMode param determines whether the plugin should run in metadata mode.
Types ¶
type BackendFactoryFunc ¶
type BackendFactoryFunc func(*logical.BackendConfig) (logical.Backend, error)
type BackendPlugin ¶
type BackendPlugin struct { Factory func(*logical.BackendConfig) (logical.Backend, error) // contains filtered or unexported fields }
BackendPlugin is the plugin.Plugin implementation
func (BackendPlugin) Client ¶
func (b BackendPlugin) Client(broker *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
Client gets called on plugin.NewClient()
func (*BackendPlugin) Server ¶
func (b *BackendPlugin) Server(broker *plugin.MuxBroker) (interface{}, error)
Server gets called when on plugin.Serve()
type BackendPluginClient ¶
BackendPluginClient is a wrapper around backendPluginClient that also contains its plugin.Client instance. It's primarily used to cleanly kill the client on Cleanup()
func (*BackendPluginClient) Cleanup ¶
func (b *BackendPluginClient) Cleanup()
Cleanup calls the RPC client's Cleanup() func and also calls the go-plugin's client Kill() func
func (BackendPluginClient) HandleExistenceCheck ¶
func (BackendPluginClient) HandleRequest ¶
func (BackendPluginClient) Initialize ¶
func (b BackendPluginClient) Initialize() error
func (BackendPluginClient) InvalidateKey ¶
func (b BackendPluginClient) InvalidateKey(key string)
func (BackendPluginClient) Logger ¶
Logger returns vault's logger. The backend client stores the logger during Setup, so there is no need to shim the logger just to get it back.
func (BackendPluginClient) RegisterLicense ¶
func (b BackendPluginClient) RegisterLicense(license interface{}) error
func (BackendPluginClient) Setup ¶
func (b BackendPluginClient) Setup(config *logical.BackendConfig) error
func (BackendPluginClient) SpecialPaths ¶
func (BackendPluginClient) System ¶
func (b BackendPluginClient) System() logical.SystemView
System returns vault's system view. The backend client stores the view during Setup, so there is no need to shim the system just to get it back.
func (BackendPluginClient) Type ¶
func (b BackendPluginClient) Type() logical.BackendType
type CachingDisabledReply ¶
type CachingDisabledReply struct {
CachingDisabled bool
}
type DefaultLeaseTTLReply ¶
type HandleExistenceCheckArgs ¶
HandleExistenceCheckArgs is the args for HandleExistenceCheck method.
type HandleExistenceCheckReply ¶
HandleExistenceCheckReply is the reply for HandleExistenceCheck method.
type HandleRequestArgs ¶
HandleRequestArgs is the args for HandleRequest method.
type HandleRequestReply ¶
HandleRequestReply is the reply for HandleRequest method.
type LoggerArgs ¶
type LoggerClient ¶
type LoggerClient struct {
// contains filtered or unexported fields
}
func (*LoggerClient) Debug ¶
func (l *LoggerClient) Debug(msg string, args ...interface{})
func (*LoggerClient) Error ¶
func (l *LoggerClient) Error(msg string, args ...interface{}) error
func (*LoggerClient) Fatal ¶
func (l *LoggerClient) Fatal(msg string, args ...interface{})
func (*LoggerClient) Info ¶
func (l *LoggerClient) Info(msg string, args ...interface{})
func (*LoggerClient) IsDebug ¶
func (l *LoggerClient) IsDebug() bool
func (*LoggerClient) IsInfo ¶
func (l *LoggerClient) IsInfo() bool
func (*LoggerClient) IsTrace ¶
func (l *LoggerClient) IsTrace() bool
func (*LoggerClient) IsWarn ¶
func (l *LoggerClient) IsWarn() bool
func (*LoggerClient) Log ¶
func (l *LoggerClient) Log(level int, msg string, args []interface{})
func (*LoggerClient) SetLevel ¶
func (l *LoggerClient) SetLevel(level int)
func (*LoggerClient) Trace ¶
func (l *LoggerClient) Trace(msg string, args ...interface{})
func (*LoggerClient) Warn ¶
func (l *LoggerClient) Warn(msg string, args ...interface{}) error
type LoggerReply ¶
type LoggerReply struct { IsTrue bool Error *plugin.BasicError }
LoggerReply contains the RPC reply. Not all fields may be used for a particular RPC call.
type LoggerServer ¶
type LoggerServer struct {
// contains filtered or unexported fields
}
func (*LoggerServer) Debug ¶
func (l *LoggerServer) Debug(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) Error ¶
func (l *LoggerServer) Error(args *LoggerArgs, reply *LoggerReply) error
func (*LoggerServer) Info ¶
func (l *LoggerServer) Info(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) IsDebug ¶
func (l *LoggerServer) IsDebug(args interface{}, reply *LoggerReply) error
func (*LoggerServer) IsInfo ¶
func (l *LoggerServer) IsInfo(args interface{}, reply *LoggerReply) error
func (*LoggerServer) IsTrace ¶
func (l *LoggerServer) IsTrace(args interface{}, reply *LoggerReply) error
func (*LoggerServer) IsWarn ¶
func (l *LoggerServer) IsWarn(args interface{}, reply *LoggerReply) error
func (*LoggerServer) Log ¶
func (l *LoggerServer) Log(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) SetLevel ¶
func (l *LoggerServer) SetLevel(args int, _ *struct{}) error
func (*LoggerServer) Trace ¶
func (l *LoggerServer) Trace(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) Warn ¶
func (l *LoggerServer) Warn(args *LoggerArgs, reply *LoggerReply) error
type MaxLeaseTTLReply ¶
type MlockEnabledReply ¶
type MlockEnabledReply struct {
MlockEnabled bool
}
type NOOPStorage ¶ added in v0.8.2
type NOOPStorage struct{}
NOOPStorage is used to deny access to the storage interface while running a backend plugin in metadata mode.
func (*NOOPStorage) Delete ¶ added in v0.8.2
func (s *NOOPStorage) Delete(key string) error
func (*NOOPStorage) Get ¶ added in v0.8.2
func (s *NOOPStorage) Get(key string) (*logical.StorageEntry, error)
func (*NOOPStorage) List ¶ added in v0.8.2
func (s *NOOPStorage) List(prefix string) ([]string, error)
func (*NOOPStorage) Put ¶ added in v0.8.2
func (s *NOOPStorage) Put(entry *logical.StorageEntry) error
type RegisterLicenseArgs ¶
type RegisterLicenseArgs struct {
License interface{}
}
RegisterLicenseArgs is the args for the RegisterLicense method.
type RegisterLicenseReply ¶
type RegisterLicenseReply struct {
Error *plugin.BasicError
}
RegisterLicenseReply is the reply for the RegisterLicense method.
type ReplicationStateReply ¶
type ReplicationStateReply struct {
ReplicationState consts.ReplicationState
}
type ResponseWrapDataArgs ¶
type ResponseWrapDataReply ¶
type ResponseWrapDataReply struct { ResponseWrapInfo *wrapping.ResponseWrapInfo Error *plugin.BasicError }
type ServeOpts ¶
type ServeOpts struct { BackendFactoryFunc BackendFactoryFunc TLSProviderFunc TLSProdiverFunc }
type SetupArgs ¶
type SetupArgs struct { StorageID uint32 LoggerID uint32 SysViewID uint32 Config map[string]string }
SetupArgs is the args for Setup method.
type SetupReply ¶
type SetupReply struct {
Error *plugin.BasicError
}
SetupReply is the reply for Setup method.
type SpecialPathsReply ¶
SpecialPathsReply is the reply for SpecialPaths method.
type StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
StorageClient is an implementation of logical.Storage that communicates over RPC.
func (*StorageClient) Delete ¶
func (s *StorageClient) Delete(key string) error
func (*StorageClient) Get ¶
func (s *StorageClient) Get(key string) (*logical.StorageEntry, error)
func (*StorageClient) Put ¶
func (s *StorageClient) Put(entry *logical.StorageEntry) error
type StorageDeleteReply ¶
type StorageDeleteReply struct {
Error *plugin.BasicError
}
type StorageGetReply ¶
type StorageGetReply struct { StorageEntry *logical.StorageEntry Error *plugin.BasicError }
type StorageListReply ¶
type StorageListReply struct { Keys []string Error *plugin.BasicError }
type StoragePutReply ¶
type StoragePutReply struct {
Error *plugin.BasicError
}
type StorageServer ¶
type StorageServer struct {
// contains filtered or unexported fields
}
StorageServer is a net/rpc compatible structure for serving
func (*StorageServer) Delete ¶
func (s *StorageServer) Delete(key string, reply *StorageDeleteReply) error
func (*StorageServer) Get ¶
func (s *StorageServer) Get(key string, reply *StorageGetReply) error
func (*StorageServer) List ¶
func (s *StorageServer) List(prefix string, reply *StorageListReply) error
func (*StorageServer) Put ¶
func (s *StorageServer) Put(entry *logical.StorageEntry, reply *StoragePutReply) error
type SudoPrivilegeArgs ¶
type SudoPrivilegeReply ¶
type SudoPrivilegeReply struct {
Sudo bool
}
type SystemReply ¶
type SystemReply struct { SystemView logical.SystemView Error *plugin.BasicError }
SystemReply is the reply for System method.
type SystemViewClient ¶
type SystemViewClient struct {
// contains filtered or unexported fields
}
func (*SystemViewClient) CachingDisabled ¶
func (s *SystemViewClient) CachingDisabled() bool
func (*SystemViewClient) DefaultLeaseTTL ¶
func (s *SystemViewClient) DefaultLeaseTTL() time.Duration
func (*SystemViewClient) LookupPlugin ¶
func (s *SystemViewClient) LookupPlugin(name string) (*pluginutil.PluginRunner, error)
func (*SystemViewClient) MaxLeaseTTL ¶
func (s *SystemViewClient) MaxLeaseTTL() time.Duration
func (*SystemViewClient) MlockEnabled ¶
func (s *SystemViewClient) MlockEnabled() bool
func (*SystemViewClient) ReplicationState ¶
func (s *SystemViewClient) ReplicationState() consts.ReplicationState
func (*SystemViewClient) ResponseWrapData ¶
func (s *SystemViewClient) ResponseWrapData(data map[string]interface{}, ttl time.Duration, jwt bool) (*wrapping.ResponseWrapInfo, error)
func (*SystemViewClient) SudoPrivilege ¶
func (s *SystemViewClient) SudoPrivilege(path string, token string) bool
func (*SystemViewClient) Tainted ¶
func (s *SystemViewClient) Tainted() bool
type SystemViewServer ¶
type SystemViewServer struct {
// contains filtered or unexported fields
}
func (*SystemViewServer) CachingDisabled ¶
func (s *SystemViewServer) CachingDisabled(_ interface{}, reply *CachingDisabledReply) error
func (*SystemViewServer) DefaultLeaseTTL ¶
func (s *SystemViewServer) DefaultLeaseTTL(_ interface{}, reply *DefaultLeaseTTLReply) error
func (*SystemViewServer) MaxLeaseTTL ¶
func (s *SystemViewServer) MaxLeaseTTL(_ interface{}, reply *MaxLeaseTTLReply) error
func (*SystemViewServer) MlockEnabled ¶
func (s *SystemViewServer) MlockEnabled(_ interface{}, reply *MlockEnabledReply) error
func (*SystemViewServer) ReplicationState ¶
func (s *SystemViewServer) ReplicationState(_ interface{}, reply *ReplicationStateReply) error
func (*SystemViewServer) ResponseWrapData ¶
func (s *SystemViewServer) ResponseWrapData(args *ResponseWrapDataArgs, reply *ResponseWrapDataReply) error
func (*SystemViewServer) SudoPrivilege ¶
func (s *SystemViewServer) SudoPrivilege(args *SudoPrivilegeArgs, reply *SudoPrivilegeReply) error
func (*SystemViewServer) Tainted ¶
func (s *SystemViewServer) Tainted(_ interface{}, reply *TaintedReply) error
type TLSProdiverFunc ¶
type TaintedReply ¶
type TaintedReply struct {
Tainted bool
}
type TypeReply ¶
type TypeReply struct {
Type logical.BackendType
}
TypeReply is the reply for the Type method.