mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
mongodb secret backend: Prefix all generated usernames with "vault-", and cleanly handle empty display names when generating usernames
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/hashicorp/vault/logical"
|
||||
logicaltest "github.com/hashicorp/vault/logical/testing"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func TestBackend_basic(t *testing.T) {
|
||||
@@ -113,6 +114,9 @@ func testAccStepReadCreds(t *testing.T, name string) logicaltest.TestStep {
|
||||
if d.Username == "" {
|
||||
return fmt.Errorf("bad: %#v", resp)
|
||||
}
|
||||
if !strings.HasPrefix(d.Username, "vault-root-") {
|
||||
return fmt.Errorf("bad: %#v", resp)
|
||||
}
|
||||
if d.Password == "" {
|
||||
return fmt.Errorf("bad: %#v", resp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user