mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-06 14:47:01 +02:00
Exclude wrapping key from list operation (#30728)
* exclude wrapping key from list operation * add changelog * make delete more general
This commit is contained in:
parent
f444e37f10
commit
83d05cefb6
@ -9,6 +9,7 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -179,6 +180,15 @@ func (b *backend) pathKeysList(ctx context.Context, req *logical.Request, d *fra
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// filter out partial paths
|
||||
entries = slices.DeleteFunc(entries, func(s string) bool {
|
||||
if strings.HasSuffix(s, "/") {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
return logical.ListResponse(entries), nil
|
||||
}
|
||||
|
||||
|
3
changelog/30728.txt
Normal file
3
changelog/30728.txt
Normal file
@ -0,0 +1,3 @@
|
||||
```release-note: improvement
|
||||
transit: Exclude the partial wrapping key path from the transit/keys LIST operation.
|
||||
```
|
Loading…
Reference in New Issue
Block a user