kms.ListKeys returns CreatedBy/CreatedAt when information is available (#20223)

This commit is contained in:
Mark Theunissen
2024-08-18 16:43:03 +10:00
committed by GitHub
parent 9e81ccd2d9
commit 6378ca10a4
9 changed files with 81 additions and 71 deletions

View File

@@ -95,12 +95,12 @@ func (secretKey) Status(context.Context) (map[string]madmin.ItemState, error) {
}, nil
}
// ListKeyNames returns a list of key names. The builtin KMS consists of just a single key.
func (s secretKey) ListKeyNames(ctx context.Context, req *ListRequest) ([]string, string, error) {
// ListKeys returns a list of keys with metadata. The builtin KMS consists of just a single key.
func (s secretKey) ListKeys(ctx context.Context, req *ListRequest) ([]madmin.KMSKeyInfo, string, error) {
if strings.HasPrefix(s.keyID, req.Prefix) && strings.HasPrefix(s.keyID, req.ContinueAt) {
return []string{s.keyID}, "", nil
return []madmin.KMSKeyInfo{{Name: s.keyID}}, "", nil
}
return []string{}, "", nil
return []madmin.KMSKeyInfo{}, "", nil
}
// CreateKey returns ErrKeyExists unless req.Name is equal to the secretKey name.