aboutsummaryrefslogtreecommitdiff
path: root/server/store/store_test.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2018-08-23 22:29:46 +0100
committerNiall Sheridan <nsheridan@gmail.com>2018-08-23 22:29:46 +0100
commiteb1184b284ea37cc31556e3598916ac9c3fa6939 (patch)
tree20131b8be8e77ad1e575f8d616bf2294d3cfb888 /server/store/store_test.go
parent99225736d41e86c7f47eac4db3455b18178bba24 (diff)
Record request reason in the db instead of logging
Diffstat (limited to 'server/store/store_test.go')
-rw-r--r--server/store/store_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/store/store_test.go b/server/store/store_test.go
index 3fd900c..628c539 100644
--- a/server/store/store_test.go
+++ b/server/store/store_test.go
@@ -30,7 +30,7 @@ func TestParseCertificate(t *testing.T) {
}
s, _ := ssh.NewSignerFromKey(r)
c.SignCert(rand.Reader, s)
- rec := parseCertificate(c)
+ rec := MakeRecord(c)
a.Equal(c.KeyId, rec.KeyID)
a.Equal(c.ValidPrincipals, []string(rec.Principals))
@@ -73,7 +73,8 @@ func testStore(t *testing.T, db CertStorer) {
cert := c.(*ssh.Certificate)
cert.ValidBefore = uint64(time.Now().Add(1 * time.Hour).UTC().Unix())
cert.ValidAfter = uint64(time.Now().Add(-5 * time.Minute).UTC().Unix())
- if err := db.SetCert(cert); err != nil {
+ rec := MakeRecord(cert)
+ if err := db.SetRecord(rec); err != nil {
t.Error(err)
}
@@ -153,6 +154,6 @@ func TestMarshalCert(t *testing.T) {
if err != nil {
t.Error(err)
}
- want := `{"key_id":"id","principals":["user"],"revoked":false,"created_at":"2017-04-10 13:00:00 +0000","expires":"2017-04-11 10:00:00 +0000"}`
+ want := `{"key_id":"id","principals":["user"],"revoked":false,"created_at":"2017-04-10 13:00:00 +0000","expires":"2017-04-11 10:00:00 +0000","message":""}`
a.JSONEq(want, string(b))
}