Skip to content

Commit 783a9e5

Browse files
authored
Fix regression in returning empty value for approle cidrlist. (#13235)
1 parent 17cb1c6 commit 783a9e5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

builtin/credential/approle/validation.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ func decodeSecretIDStorageEntry(entry *logical.StorageEntry) (*secretIDStorageEn
118118
}
119119

120120
cleanup := func(in []string) []string {
121+
if len(in) == 0 {
122+
// Don't change unnecessarily, if it was empty list leave as empty list
123+
// instead of making it nil.
124+
return in
125+
}
121126
var out []string
122127
for _, s := range in {
123128
out = append(out, parseip.TrimLeadingZeroesCIDR(s))

changelog/13235.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
auth/approle: Fix regression where unset cidrlist is returned as nil instead of zero-length array.
3+
```

0 commit comments

Comments
 (0)