feat: lazysecrets list prints everything lazysecrets can find, for fzf and editor pickers #70
No files matched your search
@@ -303,6 +303,10 @@ func Azure(delay time.Duration) *Provider {
|
|||||||
Name: "legacy-token", Version: "0c11de", Enabled: &yes, Updated: base.AddDate(-1, 0, 0),
|
Name: "legacy-token", Version: "0c11de", Enabled: &yes, Updated: base.AddDate(-1, 0, 0),
|
||||||
Expires: base.AddDate(0, -3, 0), Reference: secretRef("kv-app-prod", "legacy-token"),
|
Expires: base.AddDate(0, -3, 0), Reference: secretRef("kv-app-prod", "legacy-token"),
|
||||||
}, "deprecated")
|
}, "deprecated")
|
||||||
|
p.add(kv, provider.TypeSecret, provider.Object{
|
||||||
|
Name: "smtp-password", Version: "7d2e90", Enabled: &no, Updated: base.AddDate(0, -2, 0),
|
||||||
|
Reference: secretRef("kv-app-prod", "smtp-password"),
|
||||||
|
}, "smtp-demo-password")
|
||||||
|
|
||||||
p.add(kv, provider.TypeKey, provider.Object{
|
p.add(kv, provider.TypeKey, provider.Object{
|
||||||
Name: "signing-key", Version: "5e21b7", Enabled: &yes, Updated: base.AddDate(0, -3, 0),
|
Name: "signing-key", Version: "5e21b7", Enabled: &yes, Updated: base.AddDate(0, -3, 0),
|
||||||
@@ -350,7 +354,7 @@ func Azure(delay time.Duration) *Provider {
|
|||||||
Name: "env-share", Enabled: &yes, Updated: base, Reference: secretRef("kv-shared-prod", "env-share"),
|
Name: "env-share", Enabled: &yes, Updated: base, Reference: secretRef("kv-shared-prod", "env-share"),
|
||||||
}, "q8Zt3VwL1mXc7Rk2Pj9Ys4Hn6Bf0Ga5Ud+Te/OiWlE=")
|
}, "q8Zt3VwL1mXc7Rk2Pj9Ys4Hn6Bf0Ga5Ud+Te/OiWlE=")
|
||||||
p.add(shared, provider.TypeSecret, provider.Object{
|
p.add(shared, provider.TypeSecret, provider.Object{
|
||||||
Name: "smtp-password", Enabled: &no, Updated: base, Reference: secretRef("kv-shared-prod", "smtp-password"),
|
Name: "smtp-password", Enabled: &yes, Updated: base, Reference: secretRef("kv-shared-prod", "smtp-password"),
|
||||||
}, "smtp-demo-password")
|
}, "smtp-demo-password")
|
||||||
p.fail(shared, ErrForbiddenKeys, provider.TypeKey)
|
p.fail(shared, ErrForbiddenKeys, provider.TypeKey)
|
||||||
|
|
||||||
@@ -397,7 +401,7 @@ func AzureOps(delay time.Duration) *Provider {
|
|||||||
}, "break-glass-demo-password")
|
}, "break-glass-demo-password")
|
||||||
shared := p.addContainer(prod, "kv-shared-prod", "https://kv-shared-prod.vault.azure.net", allTypes...)
|
shared := p.addContainer(prod, "kv-shared-prod", "https://kv-shared-prod.vault.azure.net", allTypes...)
|
||||||
p.add(shared, provider.TypeSecret, provider.Object{
|
p.add(shared, provider.TypeSecret, provider.Object{
|
||||||
Name: "smtp-password", Enabled: &no, Updated: base, Reference: secretRef("kv-shared-prod", "smtp-password"),
|
Name: "smtp-password", Enabled: &yes, Updated: base, Reference: secretRef("kv-shared-prod", "smtp-password"),
|
||||||
}, "smtp-demo-password")
|
}, "smtp-demo-password")
|
||||||
// Unlike the first account, ops may read keys here.
|
// Unlike the first account, ops may read keys here.
|
||||||
p.add(shared, provider.TypeKey, provider.Object{
|
p.add(shared, provider.TypeKey, provider.Object{
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ func Seed(st *store.Store, alice, admin string) {
|
|||||||
{link: azure + "kv-breakglass.vault.azure.net/secrets/emergency-admin", account: admin, source: "sub-prod",
|
{link: azure + "kv-breakglass.vault.azure.net/secrets/emergency-admin", account: admin, source: "sub-prod",
|
||||||
path: []string{"platform-prod", "kv-breakglass"}, star: true, note: "incidents only: tell #ops when used"},
|
path: []string{"platform-prod", "kv-breakglass"}, star: true, note: "incidents only: tell #ops when used"},
|
||||||
{link: azure + "kv-shared-prod.vault.azure.net/secrets/smtp-password", account: alice, source: "sub-prod",
|
{link: azure + "kv-shared-prod.vault.azure.net/secrets/smtp-password", account: alice, source: "sub-prod",
|
||||||
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},
|
||||||
note: "migrated to Microsoft Graph sendMail; disabled, delete after Q4"},
|
{link: azure + "kv-app-prod.vault.azure.net/secrets/smtp-password", account: alice, source: "sub-prod",
|
||||||
|
path: []string{"platform-prod", "kv-app-prod"}, note: "migrated to Microsoft Graph sendMail; delete after Q4"},
|
||||||
{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, for both accounts, and a repo's file.
|
// A subscription, for both accounts, and a repo's file.
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ func TestFilter(t *testing.T) {
|
|||||||
d.keys("/")
|
d.keys("/")
|
||||||
d.typeText("api-k")
|
d.typeText("api-k")
|
||||||
d.keys("enter", "esc") // apply, then esc clears the applied filter
|
d.keys("enter", "esc") // apply, then esc clears the applied filter
|
||||||
if d.m.secrets.Len() != 3 {
|
if d.m.secrets.Len() != 4 {
|
||||||
t.Errorf("esc should clear the applied filter, visible = %d", d.m.secrets.Len())
|
t.Errorf("esc should clear the applied filter, visible = %d", d.m.secrets.Len())
|
||||||
}
|
}
|
||||||
if _, _, s := d.selected(); s != "api-key" {
|
if _, _, s := d.selected(); s != "api-key" {
|
||||||
@@ -698,13 +698,13 @@ func TestMoveWhileFiltering(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
d := newDriver(t)
|
d := newDriver(t)
|
||||||
d.keys("3", "/")
|
d.keys("3", "/")
|
||||||
d.typeText("a") // all three secrets contain an a
|
d.typeText("a") // all four secrets contain an a
|
||||||
if d.m.secrets.Len() != 3 {
|
if d.m.secrets.Len() != 4 {
|
||||||
t.Fatalf("visible = %d", d.m.secrets.Len())
|
t.Fatalf("visible = %d", d.m.secrets.Len())
|
||||||
}
|
}
|
||||||
_, _, initial := d.selected() // kept from before filtering: the middle row
|
_, _, initial := d.selected() // kept from before filtering: the middle row
|
||||||
var seen []string
|
var seen []string
|
||||||
for _, k := range []rune{'j', 'j', 'k'} {
|
for _, k := range []rune{'j', 'j', 'j', 'k'} {
|
||||||
d.send(tea.KeyPressMsg{Code: k, Mod: tea.ModCtrl})
|
d.send(tea.KeyPressMsg{Code: k, Mod: tea.ModCtrl})
|
||||||
_, _, s := d.selected()
|
_, _, s := d.selected()
|
||||||
seen = append(seen, s)
|
seen = append(seen, s)
|
||||||
@@ -712,9 +712,9 @@ func TestMoveWhileFiltering(t *testing.T) {
|
|||||||
if !d.m.secrets.Filtering() {
|
if !d.m.secrets.Filtering() {
|
||||||
t.Fatal("ctrl+j/k left filter mode")
|
t.Fatal("ctrl+j/k left filter mode")
|
||||||
}
|
}
|
||||||
// down to the bottom, stay there, back up to where it started
|
// down to the bottom, stay there, back up one
|
||||||
if seen[0] == initial || seen[1] != seen[0] || seen[2] != initial {
|
if seen[0] == initial || seen[2] != seen[1] || seen[3] != seen[0] {
|
||||||
t.Errorf("from %q, ctrl+j, ctrl+j, ctrl+k selected %v", initial, seen)
|
t.Errorf("from %q, ctrl+j ×3, ctrl+k selected %v", initial, seen)
|
||||||
}
|
}
|
||||||
if !strings.Contains(d.screen(), "ctrl+j/n down") {
|
if !strings.Contains(d.screen(), "ctrl+j/n down") {
|
||||||
t.Errorf("filter help missing ctrl+j:\n%s", d.screen())
|
t.Errorf("filter help missing ctrl+j:\n%s", d.screen())
|
||||||
|
|||||||
+2
-2
@@ -21,6 +21,7 @@
|
|||||||
│ db-password ││ │
|
│ db-password ││ │
|
||||||
│ api-key ││ │
|
│ api-key ││ │
|
||||||
│ legacy-token ✗ expired ││ │
|
│ legacy-token ✗ expired ││ │
|
||||||
|
│ smtp-password (disabled) ││ │
|
||||||
│ ││ │
|
│ ││ │
|
||||||
│ ││ │
|
│ ││ │
|
||||||
│ ││ │
|
│ ││ │
|
||||||
@@ -28,6 +29,5 @@
|
|||||||
│ ││ │
|
│ ││ │
|
||||||
│ ││ │
|
│ ││ │
|
||||||
│ ││ │
|
│ ││ │
|
||||||
│ ││ │
|
╰────────────────────── 1 of 4 ─╯╰──────────────────────────────────────────────────────── 1 of 4 ─╯
|
||||||
╰────────────────────── 1 of 3 ─╯╰──────────────────────────────────────────────────────── 1 of 4 ─╯
|
|
||||||
enter open • ctrl+s search • s copy link • S share • f star • F favourites • … • ? help • q quit
|
enter open • ctrl+s search • s copy link • S share • f star • F favourites • … • ? help • q quit
|
||||||
Reference in new issue
Block a user