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

0 commit comments

Comments
 (0)