From 762108d9ebd4be762885bbcacc1a677aeb8e4a15 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 30 Jun 2015 11:15:46 -0400 Subject: [PATCH] Put timestamp back into the username. Since Cassandra doesn't support expiration, this can be used by scripts to manually clean up old users if revocation fails for some reason. Commit contents (C)2015 Akamai Technologies, Inc. --- builtin/logical/cassandra/path_creds_create.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/logical/cassandra/path_creds_create.go b/builtin/logical/cassandra/path_creds_create.go index fc218a417..83cae1bdd 100644 --- a/builtin/logical/cassandra/path_creds_create.go +++ b/builtin/logical/cassandra/path_creds_create.go @@ -2,6 +2,7 @@ package cassandra import ( "fmt" + "time" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/logical/framework" @@ -40,7 +41,7 @@ func (b *backend) pathCredsCreateRead( } displayName := req.DisplayName - username := fmt.Sprintf("vault-%s-%s-%s", name, displayName, generateUUID()) + username := fmt.Sprintf("vault-%s-%s-%s-%d", name, displayName, generateUUID(), time.Now().Unix()) password := generateUUID() // Get our connection