feat: lazysecrets list prints everything lazysecrets can find, for fzf and editor pickers #70

Merged
keb merged 45 commits from feat/list into main 2026-10-14 21:30:44 +02:00
Showing only changes of commit 0e4580f245 - Show all commits
+9 -1
View File
@@ -1,6 +1,7 @@
package fake package fake
import ( import (
"cmp"
"strings" "strings"
"time" "time"
@@ -13,6 +14,7 @@ import (
func Seed(st *store.Store, alice, admin string) { func Seed(st *store.Store, alice, admin string) {
type item struct { type item struct {
link, account, source string link, account, source string
name string // else the link's last part
path []string path []string
star bool star bool
uses int uses int
@@ -30,9 +32,15 @@ func Seed(st *store.Store, alice, admin string) {
path: []string{"platform-prod", "kv-shared-prod"}, uses: 2, ago: 26 * time.Hour}, path: []string{"platform-prod", "kv-shared-prod"}, uses: 2, ago: 26 * time.Hour},
{link: dbx + "app/storage-key", account: "Databricks", source: "dbx-prod", {link: dbx + "app/storage-key", account: "Databricks", source: "dbx-prod",
path: []string{"prod", "app"}, star: true, uses: 3, ago: 5 * time.Hour}, path: []string{"prod", "app"}, star: true, uses: 3, ago: 5 * time.Hour},
// A subscription, and a repo's file.
{link: azure + "subscriptions/sub-prod", account: admin, source: "sub-prod",
name: "platform-prod", star: true},
{link: "lazysecrets://repo/github.com%2Facme%2Flazysecrets-demo/deploy%2Fprod%2Fsecrets.yaml", account: "Repos",
source: "/home/dev/git/lazysecrets-demo", name: "deploy/prod/secrets.yaml",
path: []string{"lazysecrets-demo"}, star: true},
} { } {
context := func(n *store.Node) { context := func(n *store.Node) {
n.Name = it.link[strings.LastIndex(it.link, "/")+1:] n.Name = cmp.Or(it.name, it.link[strings.LastIndex(it.link, "/")+1:])
n.Path, n.Source, n.Account = it.path, it.source, it.account n.Path, n.Source, n.Account = it.path, it.source, it.account
} }
if it.star { if it.star {