diff --git a/internal/provider/fake/seed.go b/internal/provider/fake/seed.go index 638de8e..5176ee9 100644 --- a/internal/provider/fake/seed.go +++ b/internal/provider/fake/seed.go @@ -1,6 +1,7 @@ package fake import ( + "cmp" "strings" "time" @@ -13,6 +14,7 @@ import ( func Seed(st *store.Store, alice, admin string) { type item struct { link, account, source string + name string // else the link's last part path []string star bool 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}, {link: dbx + "app/storage-key", account: "Databricks", source: "dbx-prod", 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) { - 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 } if it.star {