mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Update atlas-go to latest version that uses go-rootcerts
This commit is contained in:
parent
4ac6dda633
commit
c44062814c
8
Godeps/Godeps.json
generated
8
Godeps/Godeps.json
generated
@ -673,13 +673,13 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/hashicorp/atlas-go/archive",
|
||||
"Comment": "20141209094003-90-g0008886",
|
||||
"Rev": "0008886ebfa3b424bed03e2a5cbe4a2568ea0ff6"
|
||||
"Comment": "20141209094003-92-g95fa852",
|
||||
"Rev": "95fa852edca41c06c4ce526af4bb7dec4eaad434"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/hashicorp/atlas-go/v1",
|
||||
"Comment": "20141209094003-90-g0008886",
|
||||
"Rev": "0008886ebfa3b424bed03e2a5cbe4a2568ea0ff6"
|
||||
"Comment": "20141209094003-92-g95fa852",
|
||||
"Rev": "95fa852edca41c06c4ce526af4bb7dec4eaad434"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/hashicorp/consul/api",
|
||||
|
21
vendor/github.com/hashicorp/atlas-go/v1/client.go
generated
vendored
21
vendor/github.com/hashicorp/atlas-go/v1/client.go
generated
vendored
@ -2,6 +2,7 @@ package atlas
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
@ -14,6 +15,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-cleanhttp"
|
||||
"github.com/hashicorp/go-rootcerts"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -24,6 +26,14 @@ const (
|
||||
// default Atlas address.
|
||||
atlasEndpointEnvVar = "ATLAS_ADDRESS"
|
||||
|
||||
// atlasCAFileEnvVar is the environment variable that causes the client to
|
||||
// load trusted certs from a file
|
||||
atlasCAFileEnvVar = "ATLAS_CAFILE"
|
||||
|
||||
// atlasCAPathEnvVar is the environment variable that causes the client to
|
||||
// load trusted certs from a directory
|
||||
atlasCAPathEnvVar = "ATLAS_CAPATH"
|
||||
|
||||
// atlasTokenHeader is the header key used for authenticating with Atlas
|
||||
atlasTokenHeader = "X-Atlas-Token"
|
||||
)
|
||||
@ -112,6 +122,17 @@ func NewClient(urlString string) (*Client, error) {
|
||||
// init() sets defaults on the client.
|
||||
func (c *Client) init() error {
|
||||
c.HTTPClient = cleanhttp.DefaultClient()
|
||||
tlsConfig := &tls.Config{}
|
||||
err := rootcerts.ConfigureTLS(tlsConfig, &rootcerts.Config{
|
||||
CAFile: os.Getenv(atlasCAFileEnvVar),
|
||||
CAPath: os.Getenv(atlasCAPathEnvVar),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t := cleanhttp.DefaultTransport()
|
||||
t.TLSClientConfig = tlsConfig
|
||||
c.HTTPClient.Transport = t
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user