feat: lazysecrets list prints notes, and --demo has a couple
This commit is contained in:
4 files changed
+31
-18
No files matched your search
@@ -229,14 +229,14 @@ func TestListMarks(t *testing.T) {
|
||||
az := fake.Azure(0)
|
||||
var starredLink string
|
||||
got, _, _ := run(t, Options{Providers: []provider.Provider{az}, MaxAge: time.Minute, Kinds: []string{"secret"},
|
||||
Mark: func(link, account string) (bool, time.Time, int) {
|
||||
Mark: func(link, account string) (bool, time.Time, int, string) {
|
||||
if starredLink == "" && strings.HasSuffix(link, "/db-password") {
|
||||
starredLink = link
|
||||
}
|
||||
if strings.HasSuffix(link, "/api-key") {
|
||||
return false, time.Now(), 3
|
||||
return false, time.Now(), 3, "rotate in May"
|
||||
}
|
||||
return link == starredLink && account == az.ID(), time.Time{}, 0
|
||||
return link == starredLink && account == az.ID(), time.Time{}, 0, ""
|
||||
}})
|
||||
var starred, recent int
|
||||
for _, e := range got {
|
||||
@@ -246,6 +246,9 @@ func TestListMarks(t *testing.T) {
|
||||
t.Errorf("%s starred", e.Link)
|
||||
}
|
||||
}
|
||||
if (e.Note != "") != strings.HasSuffix(e.Link, "/api-key") {
|
||||
t.Errorf("%s: note %q", e.Link, e.Note)
|
||||
}
|
||||
if e.Recent {
|
||||
recent++
|
||||
if e.Uses != 3 || e.LastUsed.IsZero() {
|
||||
|
||||
Reference in new issue
Block a user