parent
dd1e425d02
commit
30788e1a70
4 changed files with 20 additions and 3 deletions
|
@ -180,3 +180,16 @@ func (*Suite) TestExpirePreauthKey(c *check.C) {
|
|||
c.Assert(err, check.Equals, errorAuthKeyExpired)
|
||||
c.Assert(p, check.IsNil)
|
||||
}
|
||||
|
||||
func (*Suite) TestNotReusableMarkedAsAlreadyUsed(c *check.C) {
|
||||
n, err := h.CreateNamespace("test6")
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
pak, err := h.CreatePreAuthKey(n.Name, false, false, nil)
|
||||
c.Assert(err, check.IsNil)
|
||||
pak.AlreadyUsed = true
|
||||
h.db.Save(&pak)
|
||||
|
||||
_, err = h.checkKeyValidity(pak.Key)
|
||||
c.Assert(err, check.Equals, errorAuthKeyNotReusableAlreadyUsed)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue