Update the api for serving plugins and provide a utility to pass TLS data for commuinicating with the vault process

This commit is contained in:
Brian Kassouf
2017-05-02 14:40:11 -07:00
parent 7f92c5f47f
commit 1df8ec9ef7
15 changed files with 310 additions and 153 deletions

View File

@@ -5,8 +5,10 @@ import (
"strings"
"time"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/builtin/logical/database/dbplugin"
"github.com/hashicorp/vault/helper/strutil"
"github.com/hashicorp/vault/plugins"
"github.com/hashicorp/vault/plugins/helper/database/connutil"
"github.com/hashicorp/vault/plugins/helper/database/credsutil"
"github.com/hashicorp/vault/plugins/helper/database/dbutil"
@@ -42,13 +44,13 @@ func New() (interface{}, error) {
}
// Run instantiates a MySQL object, and runs the RPC server for the plugin
func Run() error {
func Run(apiTLSConfig *api.TLSConfig) error {
dbType, err := New()
if err != nil {
return err
}
dbplugin.Serve(dbType.(*MySQL))
plugins.Serve(dbType.(*MySQL), apiTLSConfig)
return nil
}