From 6289db6451298ec33d01e32e46e71f684226e981 Mon Sep 17 00:00:00 2001 From: Mudassar Shafique <15931574+mudash@users.noreply.github.com> Date: Thu, 16 Apr 2020 13:35:57 -0400 Subject: [PATCH 1/3] Implementation of API calls for cookbook_artifacts end point Signed-off-by: Mudassar Shafique <15931574+mudash@users.noreply.github.com> --- cookbook_artifacts.go | 88 +++++++++ cookbook_artifacts_test.go | 134 +++++++++++++ go.mod | 27 ++- go.sum | 183 ++++++++++++++++++ http.go | 48 ++--- test/cookbook_artifacts_get_response.json | 36 ++++ ...ookbook_artifacts_getversion_response.json | 168 ++++++++++++++++ test/cookbook_artifacts_list_response.json | 60 ++++++ 8 files changed, 719 insertions(+), 25 deletions(-) create mode 100644 cookbook_artifacts.go create mode 100644 cookbook_artifacts_test.go create mode 100644 test/cookbook_artifacts_get_response.json create mode 100644 test/cookbook_artifacts_getversion_response.json create mode 100644 test/cookbook_artifacts_list_response.json diff --git a/cookbook_artifacts.go b/cookbook_artifacts.go new file mode 100644 index 0000000..780041a --- /dev/null +++ b/cookbook_artifacts.go @@ -0,0 +1,88 @@ +package chef + +import "fmt" + +// CBAService is the service for interacting with chef server cookbook_artifacts endpoint +type CBAService struct { + client *Client +} + +// CBAGetResponse is returned from the chef-server for Get Requests to /cookbook_artifacts +type CBAGetResponse map[string]CBA +type CBA struct { + Url string `json:"url,omitempty"` + CBAVersions []CBAVersion `json:"versions,omitempty"` +} +type CBAVersion struct { + Url string `json:"url,omitempty"` + Identifier string `json:"identifier,omitempty"` +} + +// CBADetail represents the detail for a specific cookbook_artifact +type CBADetail struct { + Version string `json:"version"` + Name string `json:"name"` + Identifier string `json:"identifier"` + RootFiles []CookbookItem `json:"root_files,omitempty"` + Providers []CookbookItem `json:"providers,omitempty"` + Resources []CookbookItem `json:"resources,omitempty"` + Libraries []CookbookItem `json:"libraries,omitempty"` + Attributes []CookbookItem `json:"attributes,omitempty"` + Recipes []CookbookItem `json:"recipes,omitempty"` + Definitions []CookbookItem `json:"definitions,omitempty"` + Files []CookbookItem `json:"files,omitempty"` + Templates []CookbookItem `json:"templates,omitempty"` + Frozen bool `json:"frozen?,omitempty"` + ChefType string `json:"chef_type,omitempty"` + Metadata CBAMeta `json:"metadata,omitempty"` +} + +// CBAMeta represents the cookbook_artifacts metadata information +type CBAMeta struct { + Name string `json:"name,omitempty"` + Version string `json:"version,omitempty"` + Description string `json:"description,omitempty"` + LongDescription string `json:"long_description,omitempty"` + Maintainer string `json:"maintainer,omitempty"` + MaintainerEmail string `json:"maintainer_email,omitempty"` + License string `json:"license,omitempty"` + Platforms map[string]string `json:"platforms,omitempty"` + Depends map[string]string `json:"dependencies,omitempty"` + Reccomends map[string]string `json:"recommendations,omitempty"` + Suggests map[string]string `json:"suggestions,omitempty"` + Conflicts map[string]string `json:"conflicting,omitempty"` + Provides map[string]string `json:"providing,omitempty"` + Replaces map[string]string `json:"replacing,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` // this has a format as well that could be typed, but blargh https://github.com/lob/chef/blob/master/cookbooks/apache2/metadata.json + Groupings map[string]interface{} `json:"groupings,omitempty"` // never actually seen this used.. looks like it should be map[string]map[string]string, but not sure http://docs.opscode.com/essentials_cookbook_metadata.html + Recipes map[string]string `json:"recipes,omitempty"` + SourceURL string `json:"source_url,omitempty"` + IssuesURL string `json:"issues_url,omitempty"` + Privacy bool `json:"privacy,omitempty"` + ChefVersions [][]string `json:"chef_versions,omitempty"` + OhaiVersions []string `json:"ohai_versions,omitempty"` + Gems []string `json:"gems,omitempty"` +} + +// List lists the Cookbook_Artifacts in the Chef server. +// GET /cookbook_artifacts +func (c *CBAService) List() (data CBAGetResponse, err error) { + err = c.client.magicRequestDecoder("GET", "cookbook_artifacts", nil, &data) + return +} + +// Get retruns details for a specific cookbook artifact +// GET /cookbook_artifact/name +func (c *CBAService) Get(name string) (data CBAGetResponse, err error) { + path := fmt.Sprintf("cookbook_artifacts/%s", name) + err = c.client.magicRequestDecoder("GET", path, nil, &data) + return +} + +// GetVersion fetches a specific version of a cookbook_artifact from the server api +// GET /cookbook_artifact/foo/1ef062de1bc4cb14e4a78fb739e104eb9508473e +func (c *CBAService) GetVersion(name, id string) (data CBADetail, err error) { + url := fmt.Sprintf("cookbook_artifacts/%s/%s", name, id) + err = c.client.magicRequestDecoder("GET", url, nil, &data) + return +} diff --git a/cookbook_artifacts_test.go b/cookbook_artifacts_test.go new file mode 100644 index 0000000..0c2b0ff --- /dev/null +++ b/cookbook_artifacts_test.go @@ -0,0 +1,134 @@ +package chef + +import ( + "fmt" + "io/ioutil" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" +) + +const CBAListResponseFile = "test/cookbook_artifacts_list_response.json" +const CBAGetResponseFile = "test/cookbook_artifacts_get_response.json" +const CBAGetVersionResponseFile = "test/cookbook_artifacts_getversion_response.json" + +func TestListCBA(t *testing.T) { + setup() + defer teardown() + + file, err := ioutil.ReadFile(CBAListResponseFile) + if err != nil { + t.Error(err) + } + + mux.HandleFunc("/cookbook_artifacts", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, string(file)) + }) + + data, err := client.CookbookArtifacts.List() + if err != nil { + t.Error(err) + } + + if data == nil { + t.Fatal("We should have some data") + } + + if len(data) != 2 { + t.Error("Mismatch in expected policies count. Expected 2, Got: ", len(data)) + } + + if _, ok := data["oc-hec-postfix"]; !ok { + t.Error("oc-hec-postfix policy should be listed") + } + + if _, ok := data["grafana"]; !ok { + t.Error("grafana policy should be listed") + } + +} + +func TestGetCBA(t *testing.T) { + setup() + defer teardown() + + file, err := ioutil.ReadFile(CBAGetResponseFile) + if err != nil { + t.Error(err) + } + + mux.HandleFunc("/cookbook_artifacts/seven_zip", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, string(file)) + }) + mux.HandleFunc("/cookbook_artifacts/bad", func(w http.ResponseWriter, r *http.Request) { + http.Error(w, "Not Found", 404) + }) + + data, err := client.CookbookArtifacts.Get("seven_zip") + if err != nil { + t.Error(err) + } + + if data["seven_zip"].Url != "https://localhost/organizations/utility/cookbook_artifacts/seven_zip" { + t.Errorf("URL mismatch, expected '%s', got '%s'\n", "https://api.chef.io/organizations/chef-utility/cookbook_artifacts/seven_zip", data["seven_zip"].Url) + } + + if len(data["seven_zip"].CBAVersions) != 7 { + t.Errorf("Expected 7 versions of this cookbook artifact, received %d", len(data["seven_zip"].CBAVersions)) + } + _, err = client.CookbookArtifacts.Get("bad") + if err == nil { + t.Error("We expected this bad request to error", err) + } +} + +func TestGetVersionCBA(t *testing.T) { + setup() + defer teardown() + + file, err := ioutil.ReadFile(CBAGetVersionResponseFile) + if err != nil { + t.Error(err) + } + + mux.HandleFunc("/cookbook_artifacts/seven_zip/0e1fed3b56aa5e84205e330d92aca22d8704a014", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, string(file)) + }) + mux.HandleFunc("/cookbook_artifacts/seven_zip/bad", func(w http.ResponseWriter, r *http.Request) { + http.Error(w, "Not Found", 404) + }) + + cookbookArtifact, err := client.CookbookArtifacts.GetVersion("seven_zip", "0e1fed3b56aa5e84205e330d92aca22d8704a014") + if err != nil { + t.Error(err) + } + + if assert.NotNil(t, cookbookArtifact) { + assert.Equal(t, "seven_zip", cookbookArtifact.Name) + assert.Equal(t, "3.1.2", cookbookArtifact.Version) + assert.Equal(t, "0e1fed3b56aa5e84205e330d92aca22d8704a014", cookbookArtifact.Identifier) + assert.Equal(t, 9, len(cookbookArtifact.RootFiles)) + assert.Equal(t, 1, len(cookbookArtifact.Providers)) + assert.Equal(t, 2, len(cookbookArtifact.Resources)) + assert.Equal(t, 1, len(cookbookArtifact.Libraries)) + assert.Equal(t, 1, len(cookbookArtifact.Attributes)) + assert.Equal(t, "https://s3-external-1/amazonaws.com:443/test-s3-url", cookbookArtifact.RootFiles[0].Url) + assert.Equal(t, "d07d9934f97445c5187cf86abf107b7b", cookbookArtifact.Providers[0].Checksum) + assert.Equal(t, "archive.rb", cookbookArtifact.Resources[0].Name) + assert.Equal(t, "matchers.rb", cookbookArtifact.Libraries[0].Name) + assert.Equal(t, "https://s3-external-1/amazonaws.com:443/test-s3-url-attribs", cookbookArtifact.Attributes[0].Url) + assert.Equal(t, "https://s3-external-1/amazonaws.com:443/test-s3-url-recipes", cookbookArtifact.Recipes[0].Url) + assert.Equal(t, "seven_zip", cookbookArtifact.Metadata.Name) + assert.Equal(t, "3.1.2", cookbookArtifact.Metadata.Version) + assert.Equal(t, "Apache-2.0", cookbookArtifact.Metadata.License) + assert.Equal(t, "Installs/Configures 7-Zip", cookbookArtifact.Metadata.Description) + assert.Equal(t, ">= 0.0.0", cookbookArtifact.Metadata.Depends["windows"]) + assert.Equal(t, ">= 13.0", cookbookArtifact.Metadata.ChefVersions[0][0]) + } + + _, err = client.CookbookArtifacts.GetVersion("seven_zip", "bad") + if err == nil { + t.Error("We expected this bad request to error", err) + } +} diff --git a/go.mod b/go.mod index ba9ba87..861854c 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,37 @@ module github.com/chef/go-chef go 1.12 require ( + github.com/aws/aws-sdk-go v1.30.7 // indirect + github.com/axw/gocov v1.0.0 // indirect github.com/cenkalti/backoff v2.1.1+incompatible + github.com/ctdk/chefcrypto v1.0.0 // indirect + github.com/ctdk/go-trie v0.0.0-20161110000926-fe74c509b12e // indirect github.com/ctdk/goiardi v0.11.10 github.com/davecgh/go-spew v1.1.1 github.com/google/go-cmp v0.4.0 - github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de // indirect + github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect + github.com/hashicorp/go-multierror v1.1.0 // indirect + github.com/hashicorp/go-retryablehttp v0.6.6 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/vault/api v1.0.4 // indirect + github.com/jessevdk/go-flags v1.4.0 // indirect + github.com/lib/pq v1.3.0 // indirect + github.com/mattn/goveralls v0.0.5 // indirect + github.com/mitchellh/mapstructure v1.2.2 // indirect + github.com/philhofer/fwd v1.0.0 // indirect + github.com/pierrec/lz4 v2.5.1+incompatible // indirect + github.com/pmylund/go-cache v2.1.0+incompatible // indirect github.com/r3labs/diff v0.0.0-20191120142937-b4ed99a31f5a github.com/smartystreets/assertions v1.0.1 // indirect github.com/smartystreets/goconvey v1.6.4 - github.com/stretchr/testify v1.4.0 + github.com/stretchr/testify v1.5.1 + github.com/tideland/golib v4.24.2+incompatible // indirect + github.com/tinylib/msgp v1.1.2 // indirect + golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 // indirect + golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect + golang.org/x/text v0.3.2 // indirect + golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect + golang.org/x/tools v0.0.0-20200416061724-5744cfde56ed // indirect + gopkg.in/square/go-jose.v2 v2.5.0 // indirect gopkg.in/yaml.v2 v2.2.7 // indirect ) diff --git a/go.sum b/go.sum index 826d5c9..fd5666f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,20 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aws/aws-sdk-go v1.30.7 h1:IaXfqtioP6p9SFAnNfsqdNczbR5UNbYqvcZUSsCAdTY= +github.com/aws/aws-sdk-go v1.30.7/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/axw/gocov v1.0.0 h1:YsqYR66hUmilVr23tu8USgnJIJvnwh3n7j5zRn7x4LU= +github.com/axw/gocov v1.0.0/go.mod h1:LvQpEYiwwIb2nYkXY2fDWhg9/AsYqkhmrCshjlUJECE= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/ctdk/chefcrypto v1.0.0 h1:g70yvqnaXm8ZdUc7U02oyobnEITDb9Do4S879KXDJvI= +github.com/ctdk/chefcrypto v1.0.0/go.mod h1:8O66AIPfDqQHp4XHAUecZvYCM/cre1VfszqvM1oE94I= +github.com/ctdk/go-trie v0.0.0-20161110000926-fe74c509b12e h1:SGErroaNvhPwriOHtkKbO/rwOGTLtfxp0ilroYeAOYs= +github.com/ctdk/go-trie v0.0.0-20161110000926-fe74c509b12e/go.mod h1:wsN5IcPuVEauPDWHpM6zfIbdH1e5hFxUlPfaORH7WOI= github.com/ctdk/goiardi v0.11.9 h1:OkrfamLJkktXQGc6buUvg+VMd2L3F/63zrhJCINZE8s= github.com/ctdk/goiardi v0.11.9/go.mod h1:Pr6Cj6Wsahw45myttaOEZeZ0LE7p1qzWmzgsBISkrNI= github.com/ctdk/goiardi v0.11.10 h1:IB/3Afl1pC2Q4KGwzmhHPAoJfe8VtU51wZ2V0QkvsL0= @@ -7,18 +22,109 @@ github.com/ctdk/goiardi v0.11.10/go.mod h1:Pr6Cj6Wsahw45myttaOEZeZ0LE7p1qzWmzgsB 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de h1:F7WD09S8QB4LrkEpka0dFPLSotH11HRpCsLIbIcJ7sU= github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.4 h1:1BZvpawXoJCWX6pNtow9+rpEj+3itIlutiqnntI6jOE= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM= +github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.1 h1:DMo4fmknnz0E0evoNYnV48RjWndOsmd6OW+09R3cEP8= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/vault v1.4.0 h1:pe4kdAs0Wogqv/3yi91FInkN5PXuY4IMnjgz3LurGtg= +github.com/hashicorp/vault/api v1.0.4 h1:j08Or/wryXT4AcHj1oCbMd7IijXcKzYUGw59LGu9onU= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/sdk v0.1.13 h1:mOEPeOhT7jl0J4AMl1E705+BcmeRs1VmKNb9F0sMLy8= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/goveralls v0.0.5 h1:spfq8AyZ0cCk57Za6/juJ5btQxeE1FaEGMdfcI+XO48= +github.com/mattn/goveralls v0.0.5/go.mod h1:Xg2LHi51faXLyKXwsndxiW6uxEEQT9+3sjGzzwU4xy0= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= +github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= +github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.5.1+incompatible h1:Yq0up0149Hh5Ekhm/91lgkZuD1ZDnXNM26bycpTzYBM= +github.com/pierrec/lz4 v2.5.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmylund/go-cache v1.0.0 h1:jbJMNhn4LhBfb3dRejPlnjxSiokDt4qO5NWt8mMi+UE= +github.com/pmylund/go-cache v2.1.0+incompatible h1:n+7K51jLz6a3sCvff3BppuCAkixuDHuJ/C57Vw/XjTE= +github.com/pmylund/go-cache v2.1.0+incompatible/go.mod h1:hmz95dGvINpbRZGsqPcd7B5xXY5+EKb5PpGhQY3NTHk= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/r3labs/diff v0.0.0-20191120142937-b4ed99a31f5a h1:2v4Ipjxa3sh+xn6GvtgrMub2ci4ZLQMvTaYIba2lfdc= github.com/r3labs/diff v0.0.0-20191120142937-b4ed99a31f5a/go.mod h1:ozniNEFS3j1qCwHKdvraMn1WJOsUxHd7lYfukEIS4cs= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= @@ -28,16 +134,93 @@ github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:s github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tideland/golib v4.24.2+incompatible h1:QYMkA3Sr1G8UWJTDsptrLOUwB6N89ETlVBnK5lZXKAw= +github.com/tideland/golib v4.24.2+incompatible/go.mod h1:HPHOmtCdCHUQiGAVZnlOH5eNTAEmM7R9oCFXdgvkB+Y= +github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= +github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774 h1:CQVOmarCBFzTx0kbOU0ru54Cvot8SdSrNYjZPhQl+gk= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200113040837-eac381796e91/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200416061724-5744cfde56ed h1:PoCteSKZ5i8y25HqKXNerIf2SJtKTwy6dMdrcG/ZJVc= +golang.org/x/tools v0.0.0-20200416061724-5744cfde56ed/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.0 h1:OZ4sdq+Y+SHfYB7vfthi1Ei8b0vkP8ZPQgUfUwdUSqo= +gopkg.in/square/go-jose.v2 v2.5.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/http.go b/http.go index 09364d2..06232b2 100644 --- a/http.go +++ b/http.go @@ -40,27 +40,28 @@ type Client struct { BaseURL *url.URL client *http.Client - ACLs *ACLService - Associations *AssociationService - AuthenticateUser *AuthenticateUserService - Clients *ApiClientService - Cookbooks *CookbookService - DataBags *DataBagService - Environments *EnvironmentService - Groups *GroupService - License *LicenseService - Nodes *NodeService - Organizations *OrganizationService - Principals *PrincipalService - Roles *RoleService - Sandboxes *SandboxService - Search *SearchService - Status *StatusService - Universe *UniverseService - UpdatedSince *UpdatedSinceService - Users *UserService - Policies *PolicyService - PolicyGroups *PolicyGroupService + ACLs *ACLService + Associations *AssociationService + AuthenticateUser *AuthenticateUserService + Clients *ApiClientService + Cookbooks *CookbookService + CookbookArtifacts *CBAService + DataBags *DataBagService + Environments *EnvironmentService + Groups *GroupService + License *LicenseService + Nodes *NodeService + Organizations *OrganizationService + Policies *PolicyService + PolicyGroups *PolicyGroupService + Principals *PrincipalService + Roles *RoleService + Sandboxes *SandboxService + Search *SearchService + Status *StatusService + Universe *UniverseService + UpdatedSince *UpdatedSinceService + Users *UserService } // Config contains the configuration options for a chef client. This structure is used primarily in the NewClient() constructor in order to setup a proper client object @@ -173,12 +174,15 @@ func NewClient(cfg *Config) (*Client, error) { c.Associations = &AssociationService{client: c} c.Clients = &ApiClientService{client: c} c.Cookbooks = &CookbookService{client: c} + c.CookbookArtifacts = &CBAService{client: c} c.DataBags = &DataBagService{client: c} c.Environments = &EnvironmentService{client: c} c.Groups = &GroupService{client: c} c.License = &LicenseService{client: c} c.Nodes = &NodeService{client: c} c.Organizations = &OrganizationService{client: c} + c.Policies = &PolicyService{client: c} + c.PolicyGroups = &PolicyGroupService{client: c} c.Principals = &PrincipalService{client: c} c.Roles = &RoleService{client: c} c.Sandboxes = &SandboxService{client: c} @@ -187,8 +191,6 @@ func NewClient(cfg *Config) (*Client, error) { c.UpdatedSince = &UpdatedSinceService{client: c} c.Universe = &UniverseService{client: c} c.Users = &UserService{client: c} - c.Policies = &PolicyService{client: c} - c.PolicyGroups = &PolicyGroupService{client: c} return c, nil } diff --git a/test/cookbook_artifacts_get_response.json b/test/cookbook_artifacts_get_response.json new file mode 100644 index 0000000..8058e6e --- /dev/null +++ b/test/cookbook_artifacts_get_response.json @@ -0,0 +1,36 @@ +{ + "seven_zip": { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip", + "versions": [ + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip/0e1fed3b56aa5e84205e330d92aca22d8704a014", + "identifier": "0e1fed3b56aa5e84205e330d92aca22d8704a014" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip/1ef062de1bc4cb14e4a78fb739e104eb9508473e", + "identifier": "1ef062de1bc4cb14e4a78fb739e104eb9508473e" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip/7fc2816d5d906b4e5fd7d69f8e025e37276995e3", + "identifier": "7fc2816d5d906b4e5fd7d69f8e025e37276995e3" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip/8e6795446cfa8e0a4a09cef4d5d35eb2d522a24d", + "identifier": "8e6795446cfa8e0a4a09cef4d5d35eb2d522a24d" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip/8e6bde2b1a92690253e9c55d717870376718cf59", + "identifier": "8e6bde2b1a92690253e9c55d717870376718cf59" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip/91ab727ea5b817801e0799cc82a03910a806f91b", + "identifier": "91ab727ea5b817801e0799cc82a03910a806f91b" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/seven_zip/a76d3fe4342d6eba9c88a3282920eceb511bafe9", + "identifier": "a76d3fe4342d6eba9c88a3282920eceb511bafe9" + } + ] + } + } + \ No newline at end of file diff --git a/test/cookbook_artifacts_getversion_response.json b/test/cookbook_artifacts_getversion_response.json new file mode 100644 index 0000000..248a94d --- /dev/null +++ b/test/cookbook_artifacts_getversion_response.json @@ -0,0 +1,168 @@ +{ + "version": "3.1.2", + "name": "seven_zip", + "identifier": "0e1fed3b56aa5e84205e330d92aca22d8704a014", + "root_files": [ + { + "name": "rakefile.rb", + "path": "rakefile.rb", + "checksum": "b29a594bd032d8d8dd71c45c6542f35a", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "LICENSE", + "path": "LICENSE", + "checksum": "8f7bb094c7232b058c7e9f2e431f389c", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "metadata.json", + "path": "metadata.json", + "checksum": "83b1e389df1d7dae8a94f5bc09e03d81", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "README.md", + "path": "README.md", + "checksum": "12305bcff9538b0f3c5cdd9fc74b62af", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "appveyor.yml", + "path": "appveyor.yml", + "checksum": "b1d03243e7b95d6c5c9d6a64025cbd10", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "Gemfile", + "path": "Gemfile", + "checksum": "e7b3b1920e1664503bff23ca94ff0ebb", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "Gemfile.lock", + "path": "Gemfile.lock", + "checksum": "14566955879e1f64d7c5d5bc5f6895c5", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "metadata.rb", + "path": "metadata.rb", + "checksum": "72509fb8ec0d81b6bf15bc36646d434e", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "chefignore", + "path": "chefignore", + "checksum": "9a646631ee334b6efea7b2f33487e51a", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + } + ], + "providers": [ + { + "name": "archive.rb", + "path": "providers/archive.rb", + "checksum": "d07d9934f97445c5187cf86abf107b7b", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + } + ], + "resources": [ + { + "name": "archive.rb", + "path": "resources/archive.rb", + "checksum": "9ef6c1c23ef172d6c423d71211889010", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + }, + { + "name": "tool.rb", + "path": "resources/tool.rb", + "checksum": "b2e49b646d1fe7797a2e02562fe7d094", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + } + ], + "libraries": [ + { + "name": "matchers.rb", + "path": "libraries/matchers.rb", + "checksum": "aa8318097461f7678a40998d0d167cb1", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url" + } + ], + "attributes": [ + { + "name": "default.rb", + "path": "attributes/default.rb", + "checksum": "1ea5258f80c7e3f62c6872a9dcc3390a", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url-attribs" + } + ], + "recipes": [ + { + "name": "default.rb", + "path": "recipes/default.rb", + "checksum": "e9591193bbf7636d3fc7739c0befa2f1", + "specificity": "default", + "url": "https://s3-external-1/amazonaws.com:443/test-s3-url-recipes" + } + ], + "definitions": [ + + ], + "files": [ + + ], + "templates": [ + + ], + "frozen?": false, + "chef_type": "cookbook_version", + "metadata": { + "name": "seven_zip", + "description": "Installs/Configures 7-Zip", + "long_description": "[![Cookbook Version](http://img.shields.io/cookbook/v/seven_zip.svg)](https://supermarket.chef.io/cookbooks/seven_zip)\n[![Build status](https://ci.appveyor.com/api/projects/status/y1lsnlkd2b3q6gfd/branch/master?svg=true)](https://ci.appveyor.com/project/ChefWindowsCookbooks65871/seven-zip/branch/master)\n\n# seven_zip Cookbook\n[7-Zip](http://www.7-zip.org/) is a file archiver with a high compression ratio. This cookbook installs the full 7-Zip suite of tools (GUI and CLI). This cookbook replaces the older [7-Zip cookbook](https://github.com/sneal/7-zip).\n\n# Requirements\n## Platforms\n- Windows XP\n- Windows Vista\n- Windows 7\n- Windows 8, 8.1\n- Windows 10\n- Windows Server 2003 R2\n- Windows Server 2008 (R1, R2)\n- Windows Server 2012 (R1, R2)\n\n## Chef\n- Chef >= 13.0\n\n## Cookbooks\n- windows\n\n# Attributes\n## Optional\n\n| Key | Type | Description | Default |\n|-----|------|-------------|---------|\n| `['seven_zip']['home']` | String | 7-Zip installation directory. | |\n| `['seven_zip']['syspath']` | Boolean | If true, adds 7-Zip directory to system PATH environment variable. | |\n| `['seven_zip']['default_extract_timeout']` | Integer | The default timeout for an extract operation in seconds. This can be overridden by a resource attribute. | `600` |\n\n# Usage\n## default\n\nAdd `seven_zip::default` to your run\\_list which will download and install 7-Zip for the current Windows platform.\n\n# Resource/Provider\n## seven_zip_archive\nExtracts a 7-Zip compatible archive (iso, zip, 7z, etc.) to the specified destination directory.\n\n#### Actions\n- `:extract` - Extract a 7-Zip compatible archive.\n\n#### Attribute Parameters\n- `path` - Name attribute. The destination to extract to.\n- `source` - The file path to the archive to extract.\n- `overwrite` - Defaults to false. If true, the destination files will be overwritten.\n- `checksum` - The archive file checksum.\n- `timeout` - The extract action timeout in seconds, defaults to `node['seven_zip']['default_extract_timeout']`.\n\n#### Examples\nExtract 7-Zip source files to `C:\\seven_zip_source`.\n\n```ruby\nseven_zip_archive 'seven_zip_source' do\n path 'C:\\seven_zip_source'\n source 'https://www.7-zip.org/a/7z1805-src.7z'\n overwrite true\n checksum 'd9acfcbbdcad078435586e00f73909358ed8d714d106e064dcba52fa73e75d83'\n timeout 30\nend\n```\n\n## seven_zip_tool\nDownload and install 7-zip for the current Windows platform.\n\n#### Actions\n- `:install` - Installs 7-zip\n- `:add_to_path` - Add 7-zip to the PATH\n\n#### Attribute Parameters\n- `package` - The name of the package.\n- `path` - The install directory of 7-zip.\n- `source` - The source URL of the 7-zip package.\n- `checksum` - The 7-zip package checksum.\n\n#### Examples\nInstall 7-zip in `C:\\7z` and add it to the path.\n\n```ruby\nseven_zip_tool '7z 15.14 install' do\n action [:install, :add_to_path]\n package '7-Zip 15.14'\n path 'C:\\7z'\n source 'http://www.7-zip.org/a/7z1514.msi'\n checksum 'eaf58e29941d8ca95045946949d75d9b5455fac167df979a7f8e4a6bf2d39680'\nend\n```\n\n# Recipes\n## default\n\nInstalls 7-Zip and adds it to your system PATH.\n\n# License & Authors\n- Author:: Seth Chisamore ()\n- Author:: Shawn Neal ()\n\n```text\nCopyright:: 2011-2016, Chef Software, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n", + "maintainer": "Shawn Neal", + "maintainer_email": "sneal@sneal.net", + "license": "Apache-2.0", + "platforms": { + "windows": ">= 0.0.0" + }, + "dependencies": { + "windows": ">= 0.0.0" + }, + "providing": { + "seven_zip": ">= 0.0.0" + }, + "recipes": { + "seven_zip": "" + }, + "version": "3.1.2", + "source_url": "https://github.com/windowschefcookbooks/seven_zip", + "issues_url": "https://github.com/windowschefcookbooks/seven_zip/issues", + "privacy": false, + "chef_versions": [ + [ + ">= 13.0" + ] + ], + "ohai_versions": [ + + ], + "gems": [ + + ] + } +} diff --git a/test/cookbook_artifacts_list_response.json b/test/cookbook_artifacts_list_response.json new file mode 100644 index 0000000..d8ece4d --- /dev/null +++ b/test/cookbook_artifacts_list_response.json @@ -0,0 +1,60 @@ +{ + "oc-hec-postfix": { + "url": "https://localhost/organizations/utility/cookbook_artifacts/oc-hec-postfix", + "versions": [ + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/oc-hec-postfix/5368d0cfbfc364ffe743b42bf8feef36028e423e", + "identifier": "5368d0cfbfc364ffe743b42bf8feef36028e423e" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/oc-hec-postfix/55c0f568df7e4623c57b2a2e3ad8e08c418b679d", + "identifier": "55c0f568df7e4623c57b2a2e3ad8e08c418b679d" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/oc-hec-postfix/93165aab7ca88ba480c17f760479cdb33d6abf2f", + "identifier": "93165aab7ca88ba480c17f760479cdb33d6abf2f" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/oc-hec-postfix/d66ca72c4cba013299411d68e1ac3433b091da2a", + "identifier": "d66ca72c4cba013299411d68e1ac3433b091da2a" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/oc-hec-postfix/e300327ad97d961a55e4da35b630329b7360fe8c", + "identifier": "e300327ad97d961a55e4da35b630329b7360fe8c" + } + ] + }, + "grafana": { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana", + "versions": [ + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana/0fd24e584b4f1c7e87f932db10e610c3dd066da7", + "identifier": "0fd24e584b4f1c7e87f932db10e610c3dd066da7" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana/5102de2e0d5a07c68c4dee9836642475262bdd17", + "identifier": "5102de2e0d5a07c68c4dee9836642475262bdd17" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana/660d1b4ad66e53ceb1f9bcd79accc941461dd8ac", + "identifier": "660d1b4ad66e53ceb1f9bcd79accc941461dd8ac" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana/861954fd68b59f8178d538d95bbe43ec91fb682c", + "identifier": "861954fd68b59f8178d538d95bbe43ec91fb682c" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana/906f880d7b051176fd558088289d19560e0a0548", + "identifier": "906f880d7b051176fd558088289d19560e0a0548" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana/dea189b1e6119ee3f364919ffc61637737fbc87f", + "identifier": "dea189b1e6119ee3f364919ffc61637737fbc87f" + }, + { + "url": "https://localhost/organizations/utility/cookbook_artifacts/grafana/f58f797cf604aecb6781812057a1591a86df99a8", + "identifier": "f58f797cf604aecb6781812057a1591a86df99a8" + } + ] + } +} \ No newline at end of file From f18e66e11327c9b7420652b7393aab264cd14a25 Mon Sep 17 00:00:00 2001 From: Mudassar Shafique <15931574+mudash@users.noreply.github.com> Date: Thu, 16 Apr 2020 13:47:13 -0400 Subject: [PATCH 2/3] Implementation of API calls for cookbook_artifacts end point Signed-off-by: Mudassar Shafique <15931574+mudash@users.noreply.github.com> --- cookbook_artifacts.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbook_artifacts.go b/cookbook_artifacts.go index 780041a..31c875c 100644 --- a/cookbook_artifacts.go +++ b/cookbook_artifacts.go @@ -53,8 +53,8 @@ type CBAMeta struct { Conflicts map[string]string `json:"conflicting,omitempty"` Provides map[string]string `json:"providing,omitempty"` Replaces map[string]string `json:"replacing,omitempty"` - Attributes map[string]interface{} `json:"attributes,omitempty"` // this has a format as well that could be typed, but blargh https://github.com/lob/chef/blob/master/cookbooks/apache2/metadata.json - Groupings map[string]interface{} `json:"groupings,omitempty"` // never actually seen this used.. looks like it should be map[string]map[string]string, but not sure http://docs.opscode.com/essentials_cookbook_metadata.html + Attributes map[string]interface{} `json:"attributes,omitempty"` + Groupings map[string]interface{} `json:"groupings,omitempty"` Recipes map[string]string `json:"recipes,omitempty"` SourceURL string `json:"source_url,omitempty"` IssuesURL string `json:"issues_url,omitempty"` @@ -72,7 +72,7 @@ func (c *CBAService) List() (data CBAGetResponse, err error) { } // Get retruns details for a specific cookbook artifact -// GET /cookbook_artifact/name +// GET /cookbook_artifacts/name func (c *CBAService) Get(name string) (data CBAGetResponse, err error) { path := fmt.Sprintf("cookbook_artifacts/%s", name) err = c.client.magicRequestDecoder("GET", path, nil, &data) @@ -80,7 +80,7 @@ func (c *CBAService) Get(name string) (data CBAGetResponse, err error) { } // GetVersion fetches a specific version of a cookbook_artifact from the server api -// GET /cookbook_artifact/foo/1ef062de1bc4cb14e4a78fb739e104eb9508473e +// GET /cookbook_artifacts/foo/1ef062de1bc4cb14e4a78fb739e104eb9508473e func (c *CBAService) GetVersion(name, id string) (data CBADetail, err error) { url := fmt.Sprintf("cookbook_artifacts/%s/%s", name, id) err = c.client.magicRequestDecoder("GET", url, nil, &data) From 166142b0be631e6bb29e1663c2d748fd0dc0544e Mon Sep 17 00:00:00 2001 From: Mudassar Shafique <15931574+mudash@users.noreply.github.com> Date: Fri, 17 Apr 2020 14:17:52 -0400 Subject: [PATCH 3/3] Message text updates Signed-off-by: Mudassar Shafique <15931574+mudash@users.noreply.github.com> --- cookbook_artifacts.go | 2 +- cookbook_artifacts_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbook_artifacts.go b/cookbook_artifacts.go index 31c875c..29f3358 100644 --- a/cookbook_artifacts.go +++ b/cookbook_artifacts.go @@ -71,7 +71,7 @@ func (c *CBAService) List() (data CBAGetResponse, err error) { return } -// Get retruns details for a specific cookbook artifact +// Get returns details for a specific cookbook artifact // GET /cookbook_artifacts/name func (c *CBAService) Get(name string) (data CBAGetResponse, err error) { path := fmt.Sprintf("cookbook_artifacts/%s", name) diff --git a/cookbook_artifacts_test.go b/cookbook_artifacts_test.go index 0c2b0ff..eccc3b4 100644 --- a/cookbook_artifacts_test.go +++ b/cookbook_artifacts_test.go @@ -36,15 +36,15 @@ func TestListCBA(t *testing.T) { } if len(data) != 2 { - t.Error("Mismatch in expected policies count. Expected 2, Got: ", len(data)) + t.Error("Mismatch in expected cookbook artifact count. Expected 2, Got: ", len(data)) } if _, ok := data["oc-hec-postfix"]; !ok { - t.Error("oc-hec-postfix policy should be listed") + t.Error("oc-hec-postfix cookbook artifact should be listed") } if _, ok := data["grafana"]; !ok { - t.Error("grafana policy should be listed") + t.Error("grafana cookbook artifact should be listed") } }