mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Abstract out adding external plugins
This commit is contained in:
@@ -56,12 +56,14 @@ import (
|
||||
// Thus, rather than creating multiple instances of it, we only need one.
|
||||
var Registry = newRegistry()
|
||||
|
||||
var addExternalPlugins = addExtPluginsImpl
|
||||
|
||||
// BuiltinFactory is the func signature that should be returned by
|
||||
// the plugin's New() func.
|
||||
type BuiltinFactory func() (interface{}, error)
|
||||
|
||||
func newRegistry() *registry {
|
||||
return ®istry{
|
||||
reg := ®istry{
|
||||
credentialBackends: map[string]logical.Factory{
|
||||
"alicloud": credAliCloud.Factory,
|
||||
"app-id": credAppId.Factory,
|
||||
@@ -119,8 +121,14 @@ func newRegistry() *registry {
|
||||
"transit": logicalTransit.Factory,
|
||||
},
|
||||
}
|
||||
|
||||
addExternalPlugins(reg)
|
||||
|
||||
return reg
|
||||
}
|
||||
|
||||
func addExtPluginsImpl(r *registry) {}
|
||||
|
||||
type registry struct {
|
||||
credentialBackends map[string]logical.Factory
|
||||
databasePlugins map[string]BuiltinFactory
|
||||
|
||||
Reference in New Issue
Block a user