feat: lazysecrets list marks expiring and expired secrets, and its JSON has expires and enabled

This commit is contained in:
keb committed 2026-10-14 21:24:01 +02:00
1 parent 33fa064104
commit b4e4c1515b
5 files changed
+80 -37

No files matched your search

+6 -1
View File
@@ -45,6 +45,10 @@ type Entry struct {
Recent bool `json:"recent"`
LastUsed time.Time `json:"lastUsed,omitzero"`
Uses int `json:"uses,omitempty"`
// Expires is when a secret, key or certificate expires, if it does;
// Enabled whether it's enabled, where the provider says (Azure).
Expires time.Time `json:"expires,omitzero"`
Enabled *bool `json:"enabled,omitempty"`
// Error says why a source's vaults or a vault's secrets couldn't be
// listed. The entry is then that source or vault, again, or with an
// account's sources unreadable, the account without a link.
@@ -200,7 +204,8 @@ func (l *lister) objects(p provider.Provider, c provider.Container, objs []provi
continue
}
l.put(p, Entry{Link: r.String(), Kind: strings.ToLower(string(o.Type)), Provider: kindOf(c.Source.Kind),
Path: []string{c.Source.Name, c.Name, o.Name}, AccountLabel: accountOf(c.Source)})
Path: []string{c.Source.Name, c.Name, o.Name}, AccountLabel: accountOf(c.Source),
Expires: o.Expires, Enabled: o.Enabled})
}
}