mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-30 19:11:09 +02:00
Added test for the empty values array case
This commit is contained in:
parent
15b883c2bc
commit
93b7a495e4
@ -238,6 +238,7 @@ func TestACL_PolicyMerge(t *testing.T) {
|
|||||||
{"deny/all", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}},
|
{"deny/all", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}},
|
||||||
{"deny/all1", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}},
|
{"deny/all1", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}},
|
||||||
{"value/merge", map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}, map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}},
|
{"value/merge", map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}, map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}},
|
||||||
|
{"value/empty", map[string][]interface{}{"empty": []interface{}{}}, map[string][]interface{}{"empty": []interface{}{}}},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range tcases {
|
for _, tc := range tcases {
|
||||||
@ -528,6 +529,24 @@ path "value/merge" {
|
|||||||
"test" = [3, 4]
|
"test" = [3, 4]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
path "value/empty" {
|
||||||
|
policy = "write"
|
||||||
|
allowed_parameters = {
|
||||||
|
"empty" = []
|
||||||
|
}
|
||||||
|
denied_parameters = {
|
||||||
|
"empty" = [1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
path "value/empty" {
|
||||||
|
policy = "write"
|
||||||
|
allowed_parameters = {
|
||||||
|
"empty" = [1]
|
||||||
|
}
|
||||||
|
denied_parameters = {
|
||||||
|
"empty" = []
|
||||||
|
}
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
//allow operation testing
|
//allow operation testing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user