From 0a47228065f533ab14478379a9d69c0e123b28b8 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 20 Jun 2017 11:46:33 -0400 Subject: [PATCH] add -verify-plugins flag to init This provides the user with the option to disable plugin signature verification. --- command/init.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/command/init.go b/command/init.go index eb48047be..c370454fa 100644 --- a/command/init.go +++ b/command/init.go @@ -36,6 +36,7 @@ func (c *InitCommand) Run(args []string) int { var flagBackend, flagGet, flagUpgrade bool var flagConfigExtra map[string]interface{} var flagPluginPath FlagStringSlice + var flagVerifyPlugins bool args = c.Meta.process(args, false) cmdFlags := c.flagSet("init") @@ -49,6 +50,7 @@ func (c *InitCommand) Run(args []string) int { cmdFlags.BoolVar(&c.reconfigure, "reconfigure", false, "reconfigure") cmdFlags.BoolVar(&flagUpgrade, "upgrade", false, "") cmdFlags.Var(&flagPluginPath, "plugin-dir", "plugin directory") + cmdFlags.BoolVar(&flagVerifyPlugins, "verify-plugins", true, "verify plugins") cmdFlags.Usage = func() { c.Ui.Error(c.Help()) } if err := cmdFlags.Parse(args); err != nil { @@ -64,8 +66,8 @@ func (c *InitCommand) Run(args []string) int { if c.providerInstaller == nil { c.providerInstaller = &discovery.ProviderInstaller{ Dir: c.pluginDir(), - PluginProtocolVersion: plugin.Handshake.ProtocolVersion, + SkipVerify: !flagVerifyPlugins, } } @@ -383,11 +385,15 @@ Options: automatic installation of plugins. This flag can be used multiple times. - -reconfigure Reconfigure the backend, ignoring any saved configuration. + -reconfigure Reconfigure the backend, ignoring any saved + configuration. -upgrade=false If installing modules (-get) or plugins (-get-plugins), ignore previously-downloaded objects and install the latest version allowed within configured constraints. + + -verify-plugins=true Verify the authenticity and integrity of automatically + downloaded plugins. ` return strings.TrimSpace(helpText) }