Skip to content

Commit

Permalink
asserts: use a timestamp for the assertion after the signing key has …
Browse files Browse the repository at this point in the history
…been created
  • Loading branch information
pedronis committed Mar 2, 2018
2 parents 6069404 + 9e06be6 commit f62b88b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion asserts/store_asserts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,15 @@ func (s *storeSuite) TestCheckAuthority(c *C) {
err := db.Add(operator)
c.Assert(err, IsNil)

otherDB := setup3rdPartySigning(c, "other", storeDB, db)

storeHeaders := map[string]interface{}{
"store": "store1",
"operator-id": operator.HeaderString("account-id"),
"timestamp": time.Now().Format(time.RFC3339),
}

// store signed by some other account fails.
otherDB := setup3rdPartySigning(c, "other", storeDB, db)
store, err := otherDB.Sign(asserts.StoreType, storeHeaders, nil, "")
c.Assert(err, IsNil)
err = db.Check(store)
Expand Down

0 comments on commit f62b88b

Please sign in to comment.