test: --demo's disabled smtp-password, with its note, is in kv-app-prod
This commit is contained in:
4 files changed
+18
-13
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),
|
||||
Expires: base.AddDate(0, -3, 0), Reference: secretRef("kv-app-prod", "legacy-token"),
|
||||
}, "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{
|
||||
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"),
|
||||
}, "q8Zt3VwL1mXc7Rk2Pj9Ys4Hn6Bf0Ga5Ud+Te/OiWlE=")
|
||||
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")
|
||||
p.fail(shared, ErrForbiddenKeys, provider.TypeKey)
|
||||
|
||||
@@ -397,7 +401,7 @@ func AzureOps(delay time.Duration) *Provider {
|
||||
}, "break-glass-demo-password")
|
||||
shared := p.addContainer(prod, "kv-shared-prod", "https://kv-shared-prod.vault.azure.net", allTypes...)
|
||||
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")
|
||||
// Unlike the first account, ops may read keys here.
|
||||
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",
|
||||
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",
|
||||
path: []string{"platform-prod", "kv-shared-prod"}, uses: 2, ago: 26 * time.Hour,
|
||||
note: "migrated to Microsoft Graph sendMail; disabled, delete after Q4"},
|
||||
path: []string{"platform-prod", "kv-shared-prod"}, uses: 2, ago: 26 * time.Hour},
|
||||
{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",
|
||||
path: []string{"prod", "app"}, star: true, uses: 3, ago: 5 * time.Hour},
|
||||
// A subscription, for both accounts, and a repo's file.
|
||||
|
||||
@@ -686,7 +686,7 @@ func TestFilter(t *testing.T) {
|
||||
d.keys("/")
|
||||
d.typeText("api-k")
|
||||
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())
|
||||
}
|
||||
if _, _, s := d.selected(); s != "api-key" {
|
||||
@@ -698,13 +698,13 @@ func TestMoveWhileFiltering(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriver(t)
|
||||
d.keys("3", "/")
|
||||
d.typeText("a") // all three secrets contain an a
|
||||
if d.m.secrets.Len() != 3 {
|
||||
d.typeText("a") // all four secrets contain an a
|
||||
if d.m.secrets.Len() != 4 {
|
||||
t.Fatalf("visible = %d", d.m.secrets.Len())
|
||||
}
|
||||
_, _, initial := d.selected() // kept from before filtering: the middle row
|
||||
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})
|
||||
_, _, s := d.selected()
|
||||
seen = append(seen, s)
|
||||
@@ -712,9 +712,9 @@ func TestMoveWhileFiltering(t *testing.T) {
|
||||
if !d.m.secrets.Filtering() {
|
||||
t.Fatal("ctrl+j/k left filter mode")
|
||||
}
|
||||
// down to the bottom, stay there, back up to where it started
|
||||
if seen[0] == initial || seen[1] != seen[0] || seen[2] != initial {
|
||||
t.Errorf("from %q, ctrl+j, ctrl+j, ctrl+k selected %v", initial, seen)
|
||||
// down to the bottom, stay there, back up one
|
||||
if seen[0] == initial || seen[2] != seen[1] || seen[3] != seen[0] {
|
||||
t.Errorf("from %q, ctrl+j ×3, ctrl+k selected %v", initial, seen)
|
||||
}
|
||||
if !strings.Contains(d.screen(), "ctrl+j/n down") {
|
||||
t.Errorf("filter help missing ctrl+j:\n%s", d.screen())
|
||||
|
||||
+2
-2
@@ -21,6 +21,7 @@
|
||||
│ db-password ││ │
|
||||
│ api-key ││ │
|
||||
│ legacy-token ✗ expired ││ │
|
||||
│ smtp-password (disabled) ││ │
|
||||
│ ││ │
|
||||
│ ││ │
|
||||
│ ││ │
|
||||
@@ -28,6 +29,5 @@
|
||||
│ ││ │
|
||||
│ ││ │
|
||||
│ ││ │
|
||||
│ ││ │
|
||||
╰────────────────────── 1 of 3 ─╯╰──────────────────────────────────────────────────────── 1 of 4 ─╯
|
||||
╰────────────────────── 1 of 4 ─╯╰──────────────────────────────────────────────────────── 1 of 4 ─╯
|
||||
enter open • ctrl+s search • s copy link • S share • f star • F favourites • … • ? help • q quit
|
||||
Reference in new issue
Block a user