From c5657be8ac4f3bf6bb750b91bad5d0adc91898c2 Mon Sep 17 00:00:00 2001 From: Lionel Hercot Date: Wed, 15 Dec 2021 23:33:23 +0100 Subject: [PATCH] Update mso-go-client to v1.2.6 --- go.mod | 2 +- go.sum | 4 ++-- .../ciscoecosystem/mso-go-client/client/client.go | 11 ++++++++++- vendor/modules.txt | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 6fd6d1ad..9f2a70dc 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.3 + github.com/ciscoecosystem/mso-go-client v1.2.6 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 f453e826..5899e77c 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.3 h1:yt7Rdm5I/CL8b2Y4Bv6AbLUFSxO4lGPh7dxvTiiQK4c= -github.com/ciscoecosystem/mso-go-client v1.2.3/go.mod h1:ffy+aqN7Zo7GZC8e0pSt+Kbc32wjqkc+zDD42Ug0lWw= +github.com/ciscoecosystem/mso-go-client v1.2.6 h1:CU8l0cs15WNJFHQLJA/hJA6H4/vgra2WbP/+Rt4h9uM= +github.com/ciscoecosystem/mso-go-client v1.2.6/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 401f9cbd..a2f72c8c 100644 --- a/vendor/github.com/ciscoecosystem/mso-go-client/client/client.go +++ b/vendor/github.com/ciscoecosystem/mso-go-client/client/client.go @@ -16,11 +16,16 @@ import ( "github.com/ciscoecosystem/mso-go-client/models" ) -const authPayload = `{ +const msoAuthPayload = `{ "username": "%s", "password": "%s" }` +const ndAuthPayload = `{ + "userName": "%s", + "userPasswd": "%s" +}` + // Client is the main entry point type Client struct { BaseURL *url.URL @@ -176,12 +181,16 @@ func (c *Client) MakeRestRequest(method string, path string, body *container.Con func (c *Client) Authenticate() error { method := "POST" path := "/api/v1/auth/login" + var authPayload string if c.platform == "nd" { + authPayload = ndAuthPayload if c.domain == "" { c.domain = "DefaultAuth" } path = "/login" + } else { + authPayload = msoAuthPayload } body, err := container.ParseJSON([]byte(fmt.Sprintf(authPayload, c.username, c.password))) if err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index ab7e02d8..883846f9 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.3 +# github.com/ciscoecosystem/mso-go-client v1.2.6 github.com/ciscoecosystem/mso-go-client/client github.com/ciscoecosystem/mso-go-client/container github.com/ciscoecosystem/mso-go-client/models