aboutsummaryrefslogtreecommitdiff
path: root/server/store/store.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/store/store.go')
-rw-r--r--server/store/store.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/store/store.go b/server/store/store.go
index c93680b..88ec7ce 100644
--- a/server/store/store.go
+++ b/server/store/store.go
@@ -5,10 +5,9 @@ import (
"fmt"
"time"
- "golang.org/x/crypto/ssh"
-
"github.com/nsheridan/cashier/lib"
"github.com/nsheridan/cashier/server/config"
+ "golang.org/x/crypto/ssh"
)
// New returns a new configured database.
@@ -26,7 +25,6 @@ func New(c config.Database) (CertStorer, error) {
// revocation purposes.
type CertStorer interface {
Get(id string) (*CertRecord, error)
- SetCert(cert *ssh.Certificate) error
SetRecord(record *CertRecord) error
List(includeExpired bool) ([]*CertRecord, error)
Revoke(id []string) error
@@ -43,6 +41,7 @@ type CertRecord struct {
Expires time.Time `json:"expires" db:"expires_at"`
Revoked bool `json:"revoked" db:"revoked"`
Raw string `json:"-" db:"raw_key"`
+ Message string `json:"message" db:"message"`
}
// MarshalJSON implements the json.Marshaler interface for the CreatedAt and
@@ -66,7 +65,8 @@ func parseTime(t uint64) time.Time {
return time.Unix(int64(t), 0)
}
-func parseCertificate(cert *ssh.Certificate) *CertRecord {
+// MakeRecord converts a Certificate to a CertRecord
+func MakeRecord(cert *ssh.Certificate) *CertRecord {
return &CertRecord{
KeyID: cert.KeyId,
Principals: StringSlice(cert.ValidPrincipals),