Exclude wrapping key from list operation (#30728)

* exclude wrapping key from list operation

* add changelog

* make delete more general
This commit is contained in:
Rachel Culpepper 2025-05-23 12:00:57 -05:00 committed by GitHub
parent f444e37f10
commit 83d05cefb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -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
View File

@ -0,0 +1,3 @@
```release-note: improvement
transit: Exclude the partial wrapping key path from the transit/keys LIST operation.
```