diff --git a/modules/vault/go.mod b/modules/vault/go.mod index 3737d2dfa8..208e256146 100644 --- a/modules/vault/go.mod +++ b/modules/vault/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/docker/docker v24.0.6+incompatible - github.com/hashicorp/vault-client-go v0.2.0 + github.com/hashicorp/vault-client-go v0.3.3 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.23.0 github.com/tidwall/gjson v1.16.0 diff --git a/modules/vault/go.sum b/modules/vault/go.sum index 5ba8a9877c..13b5b73719 100644 --- a/modules/vault/go.sum +++ b/modules/vault/go.sum @@ -61,8 +61,8 @@ github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5O github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= -github.com/hashicorp/vault-client-go v0.2.0 h1:Zzf5D2kj7QmBZE2ZTdril1aJlujMptPatxslTkdDF+U= -github.com/hashicorp/vault-client-go v0.2.0/go.mod h1:C9rbJeHeI1Dy/MXXd5YLrzRfAH27n6mARnhpvaW/8gk= +github.com/hashicorp/vault-client-go v0.3.3 h1:osw2OiT8sPnHbwJCC7sZc/NSlgN4hm0Ka1M1yXsYuHw= +github.com/hashicorp/vault-client-go v0.3.3/go.mod h1:C9rbJeHeI1Dy/MXXd5YLrzRfAH27n6mARnhpvaW/8gk= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= diff --git a/modules/vault/vault_test.go b/modules/vault/vault_test.go index c139c91611..5353f317fb 100644 --- a/modules/vault/vault_test.go +++ b/modules/vault/vault_test.go @@ -100,9 +100,9 @@ func TestVaultGetSecretPathWithClient(t *testing.T) { err = client.SetToken(token) assert.Nil(t, err) - s, err := client.Secrets.KVv2Read(ctx, "test1") + s, err := client.Secrets.KvV2Read(ctx, "test1", vaultClient.WithMountPath("secret")) assert.Nil(t, err) - assert.Equal(t, "bar1", s.Data["data"].(map[string]interface{})["foo1"]) + assert.Equal(t, "bar1", s.Data.Data["foo1"]) } func TestVaultWriteSecretWithClient(t *testing.T) { @@ -116,14 +116,15 @@ func TestVaultWriteSecretWithClient(t *testing.T) { err = client.SetToken(token) assert.Nil(t, err) - _, err = client.Secrets.KVv2Write(ctx, "test3", schema.KVv2WriteRequest{ + _, err = client.Secrets.KvV2Write(ctx, "test3", schema.KvV2WriteRequest{ Data: map[string]any{ "foo": "bar", }, - }) + }, + vaultClient.WithMountPath("secret")) assert.Nil(t, err) - s, err := client.Secrets.KVv2Read(ctx, "test3") + s, err := client.Secrets.KvV2Read(ctx, "test3", vaultClient.WithMountPath("secret")) assert.Nil(t, err) - assert.Equal(t, "bar", s.Data["data"].(map[string]interface{})["foo"]) + assert.Equal(t, "bar", s.Data.Data["foo"]) }