From fedc1a29fe565822b317375e3643dd7fc9de9f20 Mon Sep 17 00:00:00 2001 From: Lexman Date: Wed, 8 May 2019 17:04:26 -0700 Subject: [PATCH] fixes circle_ci_go-mod-vendor-check (#6704) --- .../hashicorp/vault/api/plugin_helpers.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vendor/github.com/hashicorp/vault/api/plugin_helpers.go b/vendor/github.com/hashicorp/vault/api/plugin_helpers.go index d22b8c352..e664d5ebc 100644 --- a/vendor/github.com/hashicorp/vault/api/plugin_helpers.go +++ b/vendor/github.com/hashicorp/vault/api/plugin_helpers.go @@ -12,7 +12,16 @@ import ( squarejwt "gopkg.in/square/go-jose.v2/jwt" "github.com/hashicorp/errwrap" - "github.com/hashicorp/vault/sdk/helper/pluginutil" +) + +var ( + // PluginMetadataModeEnv is an ENV name used to disable TLS communication + // to bootstrap mounting plugins. + PluginMetadataModeEnv = "VAULT_PLUGIN_METADATA_MODE" + + // PluginUnwrapTokenEnv is the ENV name used to pass unwrap tokens to the + // plugin. + PluginUnwrapTokenEnv = "VAULT_UNWRAP_TOKEN" ) // PluginAPIClientMeta is a helper that plugins can use to configure TLS connections @@ -61,12 +70,12 @@ func (f *PluginAPIClientMeta) GetTLSConfig() *TLSConfig { // VaultPluginTLSProvider is run inside a plugin and retrieves the response // wrapped TLS certificate from vault. It returns a configured TLS Config. func VaultPluginTLSProvider(apiTLSConfig *TLSConfig) func() (*tls.Config, error) { - if os.Getenv(pluginutil.PluginMetadataModeEnv) == "true" { + if os.Getenv(PluginMetadataModeEnv) == "true" { return nil } return func() (*tls.Config, error) { - unwrapToken := os.Getenv(pluginutil.PluginUnwrapTokenEnv) + unwrapToken := os.Getenv(PluginUnwrapTokenEnv) parsedJWT, err := squarejwt.ParseSigned(unwrapToken) if err != nil {