|
|
@@ -113,9 +113,9 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: "another-secret-tool",
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -132,11 +132,11 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: "another-secret-tool",
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -153,9 +153,9 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -172,11 +172,11 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -193,9 +193,9 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -212,11 +212,11 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -234,16 +234,16 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
"foo": "bar",
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
- WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]interface{}{
|
|
|
+ WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]any{
|
|
|
"foo": "bar",
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
}}),
|
|
|
DeleteWithContextFn: fake.ExpectDeleteWithContextNoCall(),
|
|
|
@@ -259,16 +259,16 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
"foo": "bar",
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
- WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]interface{}{"data": map[string]interface{}{"foo": "bar"}}),
|
|
|
+ WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]any{"data": map[string]any{"foo": "bar"}}),
|
|
|
DeleteWithContextFn: fake.ExpectDeleteWithContextNoCall(),
|
|
|
},
|
|
|
},
|
|
|
@@ -282,9 +282,9 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
"foo": "bar",
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -302,11 +302,11 @@ func TestDeleteSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
"foo": "bar",
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -421,9 +421,9 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -438,11 +438,11 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -459,13 +459,13 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
- WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]interface{}{
|
|
|
+ WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
"custom_metadata": map[string]string{
|
|
|
managedBy: managedByESO,
|
|
|
@@ -485,15 +485,15 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
fakeKey: fakeValue,
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
- WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]interface{}{"data": map[string]interface{}{fakeKey: fakeValue, "foo": fakeValue}}),
|
|
|
+ WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]any{"data": map[string]any{fakeKey: fakeValue, "foo": fakeValue}}),
|
|
|
},
|
|
|
},
|
|
|
want: want{
|
|
|
@@ -507,13 +507,13 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
"foo": fakeValue,
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
- WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]interface{}{
|
|
|
+ WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]any{
|
|
|
"foo": "new-value",
|
|
|
"custom_metadata": map[string]string{
|
|
|
managedBy: managedByESO,
|
|
|
@@ -532,15 +532,15 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
"foo": fakeValue,
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
- WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]interface{}{"data": map[string]interface{}{"foo": "new-value"}}),
|
|
|
+ WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]any{"data": map[string]any{"foo": "new-value"}}),
|
|
|
},
|
|
|
},
|
|
|
want: want{
|
|
|
@@ -554,9 +554,9 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
"foo": fakeValue,
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -574,11 +574,11 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
"foo": fakeValue,
|
|
|
},
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: managedByESO,
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -618,9 +618,9 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV1).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
fakeKey: "fake-value2",
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: "not-external-secrets",
|
|
|
},
|
|
|
}, nil),
|
|
|
@@ -635,10 +635,10 @@ func TestPushSecret(t *testing.T) {
|
|
|
args: args{
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
- ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]interface{}{
|
|
|
- "data": map[string]interface{}{
|
|
|
+ ReadWithDataWithContextFn: fake.NewReadWithContextFn(map[string]any{
|
|
|
+ "data": map[string]any{
|
|
|
fakeKey: "fake-value2",
|
|
|
- "custom_metadata": map[string]interface{}{
|
|
|
+ "custom_metadata": map[string]any{
|
|
|
managedBy: "not-external-secrets",
|
|
|
},
|
|
|
},
|
|
|
@@ -655,7 +655,7 @@ func TestPushSecret(t *testing.T) {
|
|
|
store: makeValidSecretStoreWithVersion(esv1beta1.VaultKVStoreV2).Spec.Provider.Vault,
|
|
|
vLogical: &fake.Logical{
|
|
|
ReadWithDataWithContextFn: fake.NewReadWithContextFn(nil, nil),
|
|
|
- WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]interface{}{"data": map[string]interface{}{"key1": "value1", "key2": "value2"}}),
|
|
|
+ WriteWithContextFn: fake.ExpectWriteWithContextValue(map[string]any{"data": map[string]any{"key1": "value1", "key2": "value2"}}),
|
|
|
},
|
|
|
},
|
|
|
data: &testingfake.PushSecretData{SecretKey: "", RemoteKey: "secret", Property: ""},
|