diff --git a/go.mod b/go.mod index bf9921f5..6fd6d1ad 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-mso go 1.13 require ( - github.com/ciscoecosystem/mso-go-client v1.2.2 + github.com/ciscoecosystem/mso-go-client v1.2.3 github.com/hashicorp/terraform-plugin-sdk v1.14.0 github.com/stretchr/testify v1.6.1 // indirect golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect diff --git a/go.sum b/go.sum index bc5ab9a0..f453e826 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/ciscoecosystem/mso-go-client v1.2.2 h1:5Dh0ZExnjGv1wud4FNnbV/v3z1GmnVMnNB6iZXcQV5I= -github.com/ciscoecosystem/mso-go-client v1.2.2/go.mod h1:ffy+aqN7Zo7GZC8e0pSt+Kbc32wjqkc+zDD42Ug0lWw= +github.com/ciscoecosystem/mso-go-client v1.2.3 h1:yt7Rdm5I/CL8b2Y4Bv6AbLUFSxO4lGPh7dxvTiiQK4c= +github.com/ciscoecosystem/mso-go-client v1.2.3/go.mod h1:ffy+aqN7Zo7GZC8e0pSt+Kbc32wjqkc+zDD42Ug0lWw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/vendor/github.com/ciscoecosystem/mso-go-client/client/client.go b/vendor/github.com/ciscoecosystem/mso-go-client/client/client.go index 06e7348e..401f9cbd 100644 --- a/vendor/github.com/ciscoecosystem/mso-go-client/client/client.go +++ b/vendor/github.com/ciscoecosystem/mso-go-client/client/client.go @@ -176,13 +176,19 @@ func (c *Client) MakeRestRequest(method string, path string, body *container.Con func (c *Client) Authenticate() error { method := "POST" path := "/api/v1/auth/login" + if c.platform == "nd" { - c.domain = "local" + if c.domain == "" { + c.domain = "DefaultAuth" + } path = "/login" } body, err := container.ParseJSON([]byte(fmt.Sprintf(authPayload, c.username, c.password))) - if c.domain != "" { + if err != nil { + return err + } + if c.domain != "" { if c.platform == "nd" { body.Set(c.domain, "domain") } else { @@ -193,16 +199,17 @@ func (c *Client) Authenticate() error { body.Set(domainId, "domainId") } } + + req, err := c.MakeRestRequest(method, path, body, false) if err != nil { return err } - - req, err := c.MakeRestRequest(method, path, body, false) + obj, _, err := c.Do(req) - if err != nil { return err } + if obj == nil { return errors.New("Empty response") } diff --git a/vendor/modules.txt b/vendor/modules.txt index 0b50b4a6..ab7e02d8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -56,7 +56,7 @@ github.com/aws/aws-sdk-go/service/sts/stsiface github.com/bgentry/go-netrc/netrc # github.com/bgentry/speakeasy v0.1.0 github.com/bgentry/speakeasy -# github.com/ciscoecosystem/mso-go-client v1.2.2 +# github.com/ciscoecosystem/mso-go-client v1.2.3 github.com/ciscoecosystem/mso-go-client/client github.com/ciscoecosystem/mso-go-client/container github.com/ciscoecosystem/mso-go-client/models