Skip to content

Commit

Permalink
Fix regression in returning empty value for approle cidrlist. (#13235) (
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff authored Nov 23, 2021
1 parent 3b8ac39 commit 34aa9a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/credential/approle/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ func decodeSecretIDStorageEntry(entry *logical.StorageEntry) (*secretIDStorageEn
}

cleanup := func(in []string) []string {
if len(in) == 0 {
// Don't change unnecessarily, if it was empty list leave as empty list
// instead of making it nil.
return in
}
var out []string
for _, s := range in {
out = append(out, parseip.TrimLeadingZeroesCIDR(s))
Expand Down
3 changes: 3 additions & 0 deletions changelog/13235.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
auth/approle: Fix regression where unset cidrlist is returned as nil instead of zero-length array.
```

0 comments on commit 34aa9a0

Please sign in to comment.