mirror of
https://github.com/hashicorp/vault.git
synced 2025-09-11 08:51:07 +02:00
* plugin/auth: enable multiplexing - the plugin will be multiplexed when run as an external plugin by vault versions that support secrets/auth plugin multiplexing (> 1.12) - we continue to set the TLSProviderFunc to maintain backwards compatibility with vault versions that don't support AutoMTLS (< 1.12) * enable multiplexing for secrets engines * add changelog * revert call to ServeMultiplex for pki and transit * Revert "revert call to ServeMultiplex for pki and transit" This reverts commit 755be28d14b4c4c4d884d3cf4d2ec003dda579b9.
31 lines
834 B
Go
31 lines
834 B
Go
package main
|
||
|
||
import (
|
||
"os"
|
||
|
||
hclog "github.com/hashicorp/go-hclog"
|
||
"github.com/hashicorp/vault/api"
|
||
"github.com/hashicorp/vault/builtin/credential/userpass"
|
||
"github.com/hashicorp/vault/sdk/plugin"
|
||
)
|
||
|
||
func main() {
|
||
apiClientMeta := &api.PluginAPIClientMeta{}
|
||
flags := apiClientMeta.FlagSet()
|
||
flags.Parse(os.Args[1:])
|
||
tlsConfig := apiClientMeta.GetTLSConfig()
|
||
tlsProviderFunc := api.VaultPluginTLSProvider(tlsConfig)
|
||
|
||
if err := plugin.ServeMultiplex(&plugin.ServeOpts{
|
||
BackendFactoryFunc: userpass.Factory,
|
||
// set the TLSProviderFunc so that the plugin maintains backwards
|
||
// compatibility with Vault versions that don’t support plugin AutoMTLS
|
||
TLSProviderFunc: tlsProviderFunc,
|
||
}); err != nil {
|
||
logger := hclog.New(&hclog.LoggerOptions{})
|
||
|
||
logger.Error("plugin shutting down", "error", err)
|
||
os.Exit(1)
|
||
}
|
||
}
|