feat: lazysecrets list prints notes, and --demo has a couple

This commit is contained in:
keb committed 2026-10-14 21:24:01 +02:00
1 parent 2c9c37f809
commit 824f7249c3
4 files changed
+31 -18

No files matched your search

+6 -4
View File
@@ -49,6 +49,8 @@ type Entry struct {
// Enabled whether it's enabled, where the provider says (Azure).
Expires time.Time `json:"expires,omitzero"`
Enabled *bool `json:"enabled,omitempty"`
// Note is the user's note on it, if any.
Note string `json:"note,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.
@@ -68,9 +70,9 @@ type Options struct {
// alone don't load any secrets. Lists that fail are always listed.
Kinds []string
// Mark tells whether the entry with link is starred for account,
// and when it was last used and how often (zero: not lately); nil
// marks nothing.
Mark func(link, account string) (starred bool, lastUsed time.Time, uses int)
// when it was last used and how often (zero: not lately), and its
// note; nil marks nothing.
Mark func(link, account string) (starred bool, lastUsed time.Time, uses int, note string)
Timeout func(provider.Kind) time.Duration
Now func() time.Time
}
@@ -233,7 +235,7 @@ func (l *lister) put(p provider.Provider, e Entry) {
}
e.Account = p.ID()
if l.o.Mark != nil && e.Link != "" {
e.Starred, e.LastUsed, e.Uses = l.o.Mark(e.Link, e.Account)
e.Starred, e.LastUsed, e.Uses, e.Note = l.o.Mark(e.Link, e.Account)
e.Recent = !e.LastUsed.IsZero()
}
id := p.ID() + "\x00" + e.Link + "\x00" + e.Error