Merge pull request #1144 from hashicorp/fix-cassandra-displayName-hyphens

Apply hyphen/underscore replacement across the entire username.
This commit is contained in:
Jeff Mitchell 2016-02-26 15:27:20 -05:00
commit a57cc9e1ff
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ func (b *backend) pathCredsCreateRead(
if err != nil {
return nil, err
}
username := fmt.Sprintf("vault_%s_%s_%s_%d", name, displayName, strings.Replace(userUUID, "-", "_", -1), time.Now().Unix())
username := fmt.Sprintf("vault_%s_%s_%s_%d", name, displayName, userUUID, time.Now().Unix())
username = strings.Replace(username, "-", "_", -1)
password, err := uuid.GenerateUUID()
if err != nil {
return nil, err