Skip to content

Commit

Permalink
Add SHA1 hashed tokens into the mix
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnayak committed Jan 9, 2019
1 parent f940002 commit 004ac97
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vault/token_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ func TestTokenStore_CubbyholeDeletion(t *testing.T) {
Path: "create",
ClientToken: root,
}
// Supplying token ID forces SHA1 hashing to be used
if i%2 == 0 {
tokenReq.Data = map[string]interface{}{
"id": "testroot",
}
}
resp := testMakeTokenViaRequest(t, ts, tokenReq)
token := resp.Auth.ClientToken

Expand Down Expand Up @@ -87,6 +93,13 @@ func TestTokenStore_CubbyholeTidy(t *testing.T) {
resp := testMakeTokenViaRequest(t, ts, tokenReq)
token := resp.Auth.ClientToken

// Supplying token ID forces SHA1 hashing to be used
if i%3 == 0 {
tokenReq.Data = map[string]interface{}{
"id": "testroot",
}
}

// Create 4 junk cubbyhole entries
if i%5 == 0 {
invalidToken, err := uuid.GenerateUUID()
Expand Down

0 comments on commit 004ac97

Please sign in to comment.