diff --git a/cmd/tenv/subcmd.go b/cmd/tenv/subcmd.go index 236180c8..ae58f301 100644 --- a/cmd/tenv/subcmd.go +++ b/cmd/tenv/subcmd.go @@ -401,6 +401,7 @@ func addInstallationFlags(flags *pflag.FlagSet, conf *config.Config, params subC flags.StringVarP(&conf.Arch, "arch", "a", conf.Arch, "specify arch for binaries downloading") if params.pPublicKeyPath != nil { flags.StringVarP(params.pPublicKeyPath, "key-file", "k", "", "local path to PGP public key file (replace check against remote one)") + flags.BoolVarP(&conf.SkipSignature, "skip-signature", "s", false, "skip signature checking") } } diff --git a/config/config.go b/config/config.go index f6b8b862..3d61f29d 100644 --- a/config/config.go +++ b/config/config.go @@ -125,6 +125,7 @@ type Config struct { remoteConfLoaded bool RemoteConfPath string RootPath string + SkipSignature bool Tf RemoteConfig TfKeyPath string Tg RemoteConfig diff --git a/go.mod b/go.mod index a3ac0777..20592a1e 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/hashicorp/hcl/v2 v2.21.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 - github.com/zclconf/go-cty v1.14.4 + github.com/zclconf/go-cty v1.15.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 7954203b..2b94344d 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= -github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/versionmanager/retriever/terraform/terraformretriever.go b/versionmanager/retriever/terraform/terraformretriever.go index cc5d1ea0..35310cfc 100644 --- a/versionmanager/retriever/terraform/terraformretriever.go +++ b/versionmanager/retriever/terraform/terraformretriever.go @@ -181,6 +181,10 @@ func (r TerraformRetriever) checkSumAndSig(fileName string, data []byte, downloa return err } + if r.conf.SkipSignature { + return nil + } + dataSumsSig, err := download.Bytes(downloadSumsSigURL, r.conf.Displayer.Display) if err != nil { return err diff --git a/versionmanager/retriever/tofu/tofuretriever.go b/versionmanager/retriever/tofu/tofuretriever.go index 9f0bca19..17ee6de6 100644 --- a/versionmanager/retriever/tofu/tofuretriever.go +++ b/versionmanager/retriever/tofu/tofuretriever.go @@ -156,6 +156,10 @@ func (r TofuRetriever) checkSumAndSig(version *version.Version, stable bool, dat return err } + if r.conf.SkipSignature { + return nil + } + dataSumsSig, err := download.Bytes(assetURLs[3], r.conf.Displayer.Display) if err != nil { return err