@@ -196,8 +196,7 @@ func TestGenericReplacement_specificPathWithValidation(t *testing.T) {
196
196
}
197
197
198
198
func TestGenericReplacement_specificPathUrlEncoded (t * testing.T ) {
199
- // Test that the specific-path placeholder syntax is used to find/replace placeholders that were url-encoded
200
- // along with the generic syntax, since the generic Vault path is defined
199
+ // Test that the generic replacement function can find/replace placeholders that were url-encoded
201
200
mv := helpers.MockVault {}
202
201
mv .LoadData (map [string ]interface {}{
203
202
"namespace" : "default ns" ,
@@ -240,8 +239,7 @@ func TestGenericReplacement_specificPathUrlEncoded(t *testing.T) {
240
239
}
241
240
242
241
func TestGenericReplacement_specificPathUrlEncodedWithValidation (t * testing.T ) {
243
- // Test that the specific-path placeholder syntax is used to find/replace placeholders
244
- // along with the generic syntax, since the generic Vault path is defined
242
+ // Test that the generic replacement function can find/replace placeholders that were url-encoded
245
243
mv := helpers.MockVault {}
246
244
mv .LoadData (map [string ]interface {}{
247
245
"namespace" : "default ns" ,
@@ -444,6 +442,7 @@ func TestGenericReplacement_multiString(t *testing.T) {
444
442
}
445
443
446
444
func TestGenericReplacement_multiStringSpecificPathUrlEncoded (t * testing.T ) {
445
+ // Test that multiple url-encoded placeholders in one value string can all be found/replaced.
447
446
mv := helpers.MockVault {}
448
447
mv .LoadData (map [string ]interface {}{
449
448
"name" : "my app" ,
@@ -495,7 +494,7 @@ func TestSecretReplacement_SpecificPathUrlEncoded_Base64Encoded(t *testing.T) {
495
494
496
495
dummyResource := Resource {
497
496
TemplateData : map [string ]interface {}{
498
- "url" : `JTNDcGF0aCUzQWJsYWglMkZibGFoJTIzdXNlcm5hbWUlM0U6Ly86JTNDcGF0aCUzQWJsYWglMkZibGFoJTIzcGFzc3dvcmQlM0VAcmVkaXMtbWFzdGVyLmhhcmJvci5zdmMuY2x1c3Rlci5sb2NhbC8wP2lkbGVfdGltZW91dF9zZWNvbmRzPTMwCg== ` ,
497
+ "url" : `cmVkaXM6Ly8lM0NwYXRoJTNBYmxhaCUyRmJsYWglMjN1c2VybmFtZSUzRTolM0NwYXRoJTNBYmxhaCUyRmJsYWglMjNwYXNzd29yZCUzRUByZWRpcy1tYXN0ZXIuaGFyYm9yLnN2Yy5jbHVzdGVyLmxvY2FsLzA/aWRsZV90aW1lb3V0X3NlY29uZHM9MzAK ` ,
499
498
},
500
499
Data : map [string ]interface {}{
501
500
"password" : "test" ,
@@ -511,7 +510,7 @@ func TestSecretReplacement_SpecificPathUrlEncoded_Base64Encoded(t *testing.T) {
511
510
512
511
expected := Resource {
513
512
TemplateData : map [string ]interface {}{
514
- "url" : "cmVkaXM6Ly86cmVkaXMlNDAxMjNAcmVkaXMtbWFzdGVyLmhhcmJvci5zdmMuY2x1c3Rlci5sb2NhbC8wP2lkbGVfdGltZW91dF9zZWNvbmRzPTMwCg== " ,
513
+ "url" : "cmVkaXM6Ly9yZWRpczpyZWRpcyU0MDEyM0ByZWRpcy1tYXN0ZXIuaGFyYm9yLnN2Yy5jbHVzdGVyLmxvY2FsLzA/aWRsZV90aW1lb3V0X3NlY29uZHM9MzAK " ,
515
514
},
516
515
Data : map [string ]interface {}{
517
516
"password" : "test" ,
0 commit comments