mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47:54 +00:00
Calls to builtin plugins now go directly to the implementation instead of go-plugin
This commit is contained in:
@@ -23,7 +23,7 @@ type MySQL struct {
|
||||
credsutil.CredentialsProducer
|
||||
}
|
||||
|
||||
func New() *MySQL {
|
||||
func New() (interface{}, error) {
|
||||
connProducer := &connutil.SQLConnectionProducer{}
|
||||
connProducer.Type = mySQLTypeName
|
||||
|
||||
@@ -37,14 +37,17 @@ func New() *MySQL {
|
||||
CredentialsProducer: credsProducer,
|
||||
}
|
||||
|
||||
return dbType
|
||||
return dbType, nil
|
||||
}
|
||||
|
||||
// Run instantiates a MySQL object, and runs the RPC server for the plugin
|
||||
func Run() error {
|
||||
dbType := New()
|
||||
dbType, err := New()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dbplugin.NewPluginServer(dbType)
|
||||
dbplugin.NewPluginServer(dbType.(*MySQL))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -66,7 +66,8 @@ func TestMySQL_Initialize(t *testing.T) {
|
||||
"connection_url": connURL,
|
||||
}
|
||||
|
||||
db := New()
|
||||
dbRaw, _ := New()
|
||||
db := dbRaw.(*MySQL)
|
||||
connProducer := db.ConnectionProducer.(*connutil.SQLConnectionProducer)
|
||||
|
||||
err := db.Initialize(connectionDetails, true)
|
||||
@@ -92,7 +93,8 @@ func TestMySQL_CreateUser(t *testing.T) {
|
||||
"connection_url": connURL,
|
||||
}
|
||||
|
||||
db := New()
|
||||
dbRaw, _ := New()
|
||||
db := dbRaw.(*MySQL)
|
||||
|
||||
err := db.Initialize(connectionDetails, true)
|
||||
if err != nil {
|
||||
@@ -127,7 +129,8 @@ func TestMySQL_RevokeUser(t *testing.T) {
|
||||
"connection_url": connURL,
|
||||
}
|
||||
|
||||
db := New()
|
||||
dbRaw, _ := New()
|
||||
db := dbRaw.(*MySQL)
|
||||
|
||||
err := db.Initialize(connectionDetails, true)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user