Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Commit c7308ea

Browse files
authored
Merge pull request #34 from harsimranmaan/error_message_update
Return a client error when a nodeID is not found
2 parents 37a9bfd + 04bbf3b commit c7308ea

17 files changed

+725
-761
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ defaultenv: &defaultenv
88

99
jobs:
1010
build:
11-
working_directory: /go/workdir/src/github.com/splunk/vault-plugin-splunk
1211
docker:
13-
- image: circleci/golang:1.16.6
12+
- image: cimg/go:1.18
1413
<<: *defaultenv
1514
- image: splunk/splunk:latest
1615
user: root

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ lint: dep
3636

3737
.PHONY: dep
3838
dep:
39-
./scripts/golangci-lint.sh -b $(GOBIN) v1.42.0
39+
./scripts/golangci-lint.sh -b $(GOBIN) v1.45.0
4040

4141
.PHONY: clean
4242
clean:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ accounts, including secrets rotation for compliance purposes.
1515
# Building from Source
1616

1717
```shell
18-
git clone [email protected]:splunk/vault-plugin-splunk ${GOPATH}/src/github.com/splunk/vault-plugin-splunk
19-
cd ${GOPATH}/src/github.com/splunk/vault-plugin-splunk
18+
git clone [email protected]:splunk/vault-plugin-splunk
19+
cd vault-plugin-splunk
2020
make
2121
```
2222

backend_test.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
logicaltest "github.com/hashicorp/vault/helper/testhelpers/logical"
1010
"github.com/hashicorp/vault/sdk/logical"
1111
"github.com/mitchellh/mapstructure"
12-
"gotest.tools/assert"
12+
"gotest.tools/v3/assert"
1313

1414
"github.com/splunk/vault-plugin-splunk/clients/splunk"
1515
)
@@ -40,6 +40,7 @@ func TestBackend_basic(t *testing.T) {
4040
testAccStepConfig(t),
4141
testAccStepRole(t, "test", roleConfig),
4242
testAccStepCredsRead(t, "test"),
43+
testAccStepCredsReadMultiBadConfig(t, "test"),
4344
},
4445
})
4546
}
@@ -278,6 +279,21 @@ func testAccStepCredsRead(t *testing.T, role string) logicaltest.TestStep {
278279
}
279280
}
280281

282+
func testAccStepCredsReadMultiBadConfig(t *testing.T, role string) logicaltest.TestStep {
283+
return logicaltest.TestStep{
284+
Operation: logical.ReadOperation,
285+
Path: "creds/" + role + "/someNonExistentNodeID",
286+
ErrorOk: true,
287+
Check: func(resp *logical.Response) error {
288+
if resp == nil {
289+
return fmt.Errorf("response is nil")
290+
}
291+
assert.Error(t, resp.Error(), `host "someNonExistentNodeID" not found`)
292+
return nil
293+
},
294+
}
295+
}
296+
281297
func testAccRotateRoot(t *testing.T, conn string) logicaltest.TestStep {
282298
return logicaltest.TestStep{
283299
Operation: logical.UpdateOperation,

clients/splunk/auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package splunk
33
import (
44
"testing"
55

6-
"gotest.tools/assert"
6+
"gotest.tools/v3/assert"
77
)
88

99
func TestAuthenticationService(t *testing.T) {

clients/splunk/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package splunk
33
import (
44
"testing"
55

6-
"gotest.tools/assert"
6+
"gotest.tools/v3/assert"
77
)
88

99
func TestTokenSource_Token(t *testing.T) {

clients/splunk/introspection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package splunk
33
import (
44
"testing"
55

6-
"gotest.tools/assert"
6+
"gotest.tools/v3/assert"
77
)
88

99
func testIntrospectionService(t *testing.T) *IntrospectionService {

clients/splunk/properties_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package splunk
22

33
import (
4-
"gotest.tools/assert"
54
"testing"
5+
6+
"gotest.tools/v3/assert"
67
)
78

89
func TestPropertiesService_GetKey(t *testing.T) {

clients/splunk/splunk_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package splunk
33
import (
44
"testing"
55

6-
"gotest.tools/assert"
6+
"gotest.tools/v3/assert"
77

88
"github.com/google/go-querystring/query"
99
)

clients/splunk/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"time"
1313

1414
"github.com/hashicorp/go-uuid"
15-
"github.com/ory/dockertest"
15+
"github.com/ory/dockertest/v3"
1616
"golang.org/x/oauth2"
1717
)
1818

clients/splunk/user_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/hashicorp/go-uuid"
99

10-
"gotest.tools/assert"
10+
"gotest.tools/v3/assert"
1111
)
1212

1313
const defaultAdminUser = "admin"

go.mod

Lines changed: 204 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,211 @@
11
module github.com/splunk/vault-plugin-splunk
22

3-
go 1.16
3+
go 1.18
44

55
require (
6-
github.com/dghubble/sling v1.3.0
7-
github.com/fatih/color v1.12.0 // indirect
6+
github.com/dghubble/sling v1.4.0
87
github.com/fatih/structs v1.1.0
9-
github.com/google/go-querystring v1.0.0
10-
github.com/hashicorp/go-hclog v0.16.1
8+
github.com/google/go-querystring v1.1.0
9+
github.com/hashicorp/go-hclog v1.2.0
1110
github.com/hashicorp/go-uuid v1.0.2
12-
github.com/hashicorp/vault v1.8.1
13-
github.com/hashicorp/vault/api v1.1.2-0.20210713235431-1fc8af4c041f
14-
github.com/hashicorp/vault/sdk v0.2.2-0.20210713235431-1fc8af4c041f
15-
github.com/mattn/go-isatty v0.0.13 // indirect
16-
github.com/mitchellh/mapstructure v1.3.3
17-
github.com/mr-tron/base58 v1.1.3
18-
github.com/opencontainers/runc v1.0.0-rc95 // indirect
19-
github.com/ory/dockertest v3.3.5+incompatible
20-
github.com/sethvargo/go-password v0.1.3
21-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
22-
golang.org/x/sys v0.0.0-20210818153620-00dd8d7831e7 // indirect
23-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
24-
golang.org/x/tools v0.1.5 // indirect
25-
gotest.tools v2.2.0+incompatible
11+
github.com/hashicorp/vault v1.10.0-rc1
12+
github.com/hashicorp/vault/api v1.4.1
13+
github.com/hashicorp/vault/sdk v0.4.1
14+
github.com/mitchellh/mapstructure v1.4.3
15+
github.com/mr-tron/base58 v1.2.0
16+
github.com/ory/dockertest/v3 v3.8.1
17+
github.com/sethvargo/go-password v0.2.0
18+
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a
19+
gotest.tools/v3 v3.1.0
20+
)
21+
22+
require (
23+
cloud.google.com/go v0.65.0 // indirect
24+
github.com/Azure/azure-sdk-for-go v61.4.0+incompatible // indirect
25+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
26+
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
27+
github.com/Azure/go-autorest/autorest v0.11.24 // indirect
28+
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
29+
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 // indirect
30+
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
31+
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
32+
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
33+
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
34+
github.com/Azure/go-autorest/logger v0.2.1 // indirect
35+
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
36+
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
37+
github.com/Jeffail/gabs v1.1.1 // indirect
38+
github.com/Masterminds/goutils v1.1.0 // indirect
39+
github.com/Masterminds/semver v1.5.0 // indirect
40+
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
41+
github.com/Microsoft/go-winio v0.5.1 // indirect
42+
github.com/NYTimes/gziphandler v1.1.1 // indirect
43+
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
44+
github.com/StackExchange/wmi v1.2.1 // indirect
45+
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190620160927-9418d7b0cd0f // indirect
46+
github.com/armon/go-metrics v0.3.10 // indirect
47+
github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a // indirect
48+
github.com/armon/go-radix v1.0.0 // indirect
49+
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
50+
github.com/aws/aws-sdk-go v1.37.19 // indirect
51+
github.com/beorn7/perks v1.0.1 // indirect
52+
github.com/bgentry/speakeasy v0.1.0 // indirect
53+
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
54+
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
55+
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
56+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
57+
github.com/chrismalek/oktasdk-go v0.0.0-20181212195951-3430665dfaa0 // indirect
58+
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible // indirect
59+
github.com/circonus-labs/circonusllhist v0.1.3 // indirect
60+
github.com/containerd/continuity v0.2.1 // indirect
61+
github.com/davecgh/go-spew v1.1.1 // indirect
62+
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba // indirect
63+
github.com/digitalocean/godo v1.7.5 // indirect
64+
github.com/dimchansky/utfbom v1.1.1 // indirect
65+
github.com/dnaeon/go-vcr v1.2.0 // indirect
66+
github.com/docker/cli v20.10.11+incompatible // indirect
67+
github.com/docker/docker v20.10.10+incompatible // indirect
68+
github.com/docker/go-connections v0.4.0 // indirect
69+
github.com/docker/go-units v0.4.0 // indirect
70+
github.com/duosecurity/duo_api_golang v0.0.0-20190308151101-6c680f768e74 // indirect
71+
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
72+
github.com/fatih/color v1.13.0 // indirect
73+
github.com/go-logr/logr v0.4.0 // indirect
74+
github.com/go-ole/go-ole v1.2.5 // indirect
75+
github.com/go-sql-driver/mysql v1.5.0 // indirect
76+
github.com/go-test/deep v1.0.8 // indirect
77+
github.com/gogo/protobuf v1.3.2 // indirect
78+
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
79+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
80+
github.com/golang/protobuf v1.5.2 // indirect
81+
github.com/golang/snappy v0.0.4 // indirect
82+
github.com/google/go-cmp v0.5.6 // indirect
83+
github.com/google/go-metrics-stackdriver v0.2.0 // indirect
84+
github.com/google/gofuzz v1.1.0 // indirect
85+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
86+
github.com/google/uuid v1.3.0 // indirect
87+
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
88+
github.com/googleapis/gnostic v0.5.5 // indirect
89+
github.com/gophercloud/gophercloud v0.1.0 // indirect
90+
github.com/hashicorp/consul/sdk v0.8.0 // indirect
91+
github.com/hashicorp/errwrap v1.1.0 // indirect
92+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
93+
github.com/hashicorp/go-discover v0.0.0-20210818145131-c573d69da192 // indirect
94+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
95+
github.com/hashicorp/go-kms-wrapping v0.7.0 // indirect
96+
github.com/hashicorp/go-kms-wrapping/entropy v0.1.0 // indirect
97+
github.com/hashicorp/go-memdb v1.3.2 // indirect
98+
github.com/hashicorp/go-msgpack v1.1.5 // indirect
99+
github.com/hashicorp/go-multierror v1.1.1 // indirect
100+
github.com/hashicorp/go-plugin v1.4.3 // indirect
101+
github.com/hashicorp/go-raftchunking v0.6.3-0.20191002164813-7e9e8525653a // indirect
102+
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
103+
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
104+
github.com/hashicorp/go-secure-stdlib/awsutil v0.1.5 // indirect
105+
github.com/hashicorp/go-secure-stdlib/base62 v0.1.2 // indirect
106+
github.com/hashicorp/go-secure-stdlib/mlock v0.1.2 // indirect
107+
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.3 // indirect
108+
github.com/hashicorp/go-secure-stdlib/reloadutil v0.1.1 // indirect
109+
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
110+
github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1 // indirect
111+
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
112+
github.com/hashicorp/go-version v1.4.0 // indirect
113+
github.com/hashicorp/golang-lru v0.5.4 // indirect
114+
github.com/hashicorp/hcl v1.0.1-vault-3 // indirect
115+
github.com/hashicorp/mdns v1.0.4 // indirect
116+
github.com/hashicorp/raft v1.3.3 // indirect
117+
github.com/hashicorp/raft-autopilot v0.1.3 // indirect
118+
github.com/hashicorp/raft-boltdb/v2 v2.0.0-20210421194847-a7e34179d62c // indirect
119+
github.com/hashicorp/raft-snapshot v1.0.3 // indirect
120+
github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443 // indirect
121+
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
122+
github.com/huandu/xstrings v1.3.2 // indirect
123+
github.com/imdario/mergo v0.3.12 // indirect
124+
github.com/jarcoal/httpmock v1.0.7 // indirect
125+
github.com/jefferai/isbadcipher v0.0.0-20190226160619-51d2077c035f // indirect
126+
github.com/jefferai/jsonx v1.0.0 // indirect
127+
github.com/jmespath/go-jmespath v0.4.0 // indirect
128+
github.com/joyent/triton-go v1.7.1-0.20200416154420-6801d15b779f // indirect
129+
github.com/json-iterator/go v1.1.12 // indirect
130+
github.com/keybase/go-crypto v0.0.0-20190403132359-d65b6b94177f // indirect
131+
github.com/lib/pq v1.10.3 // indirect
132+
github.com/linode/linodego v0.7.1 // indirect
133+
github.com/mattn/go-colorable v0.1.12 // indirect
134+
github.com/mattn/go-isatty v0.0.14 // indirect
135+
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
136+
github.com/miekg/dns v1.1.41 // indirect
137+
github.com/mitchellh/cli v1.1.2 // indirect
138+
github.com/mitchellh/copystructure v1.2.0 // indirect
139+
github.com/mitchellh/go-homedir v1.1.0 // indirect
140+
github.com/mitchellh/go-testing-interface v1.14.0 // indirect
141+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
142+
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
143+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
144+
github.com/modern-go/reflect2 v1.0.2 // indirect
145+
github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 // indirect
146+
github.com/oklog/run v1.1.0 // indirect
147+
github.com/opencontainers/go-digest v1.0.0 // indirect
148+
github.com/opencontainers/image-spec v1.0.2 // indirect
149+
github.com/opencontainers/runc v1.0.2 // indirect
150+
github.com/oracle/oci-go-sdk v13.1.0+incompatible // indirect
151+
github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c // indirect
152+
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
153+
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
154+
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
155+
github.com/pkg/errors v0.9.1 // indirect
156+
github.com/pmezard/go-difflib v1.0.0 // indirect
157+
github.com/posener/complete v1.2.3 // indirect
158+
github.com/pquerna/otp v1.2.1-0.20191009055518-468c2dd2b58d // indirect
159+
github.com/prometheus/client_golang v1.11.1 // indirect
160+
github.com/prometheus/client_model v0.2.0 // indirect
161+
github.com/prometheus/common v0.26.0 // indirect
162+
github.com/prometheus/procfs v0.6.0 // indirect
163+
github.com/rboyer/safeio v0.2.1 // indirect
164+
github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03 // indirect
165+
github.com/ryanuber/go-glob v1.0.0 // indirect
166+
github.com/sasha-s/go-deadlock v0.2.0 // indirect
167+
github.com/sethvargo/go-limiter v0.7.1 // indirect
168+
github.com/shirou/gopsutil v3.21.5+incompatible // indirect
169+
github.com/sirupsen/logrus v1.8.1 // indirect
170+
github.com/smartystreets/goconvey v1.6.4 // indirect
171+
github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d // indirect
172+
github.com/spf13/pflag v1.0.5 // indirect
173+
github.com/stretchr/testify v1.7.0 // indirect
174+
github.com/tencentcloud/tencentcloud-sdk-go v3.0.171+incompatible // indirect
175+
github.com/tklauser/go-sysconf v0.3.9 // indirect
176+
github.com/tklauser/numcpus v0.3.0 // indirect
177+
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c // indirect
178+
github.com/vmware/govmomi v0.18.0 // indirect
179+
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
180+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
181+
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
182+
go.etcd.io/bbolt v1.3.6 // indirect
183+
go.opencensus.io v0.23.0 // indirect
184+
go.uber.org/atomic v1.9.0 // indirect
185+
golang.org/x/crypto v0.0.0-20220208050332-20e1d8d225ab // indirect
186+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
187+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
188+
golang.org/x/sys v0.0.0-20220207234003-57398862261d // indirect
189+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
190+
golang.org/x/text v0.3.7 // indirect
191+
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
192+
google.golang.org/api v0.30.0 // indirect
193+
google.golang.org/appengine v1.6.7 // indirect
194+
google.golang.org/genproto v0.0.0-20220207185906-7721543eae58 // indirect
195+
google.golang.org/grpc v1.44.0 // indirect
196+
google.golang.org/protobuf v1.27.1 // indirect
197+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
198+
gopkg.in/inf.v0 v0.9.1 // indirect
199+
gopkg.in/ini.v1 v1.62.0 // indirect
200+
gopkg.in/resty.v1 v1.12.0 // indirect
201+
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
202+
gopkg.in/yaml.v2 v2.4.0 // indirect
203+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
204+
k8s.io/api v0.22.2 // indirect
205+
k8s.io/apimachinery v0.22.2 // indirect
206+
k8s.io/client-go v0.22.2 // indirect
207+
k8s.io/klog/v2 v2.9.0 // indirect
208+
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
209+
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
210+
sigs.k8s.io/yaml v1.2.0 // indirect
26211
)

0 commit comments

Comments
 (0)