From d0e5f62cf27d3e5c81385342c63d9f42c2eb7e2f Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Mon, 6 Aug 2018 00:25:26 +0100 Subject: Move StringSlice into the store package --- server/store/store.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'server/store/store.go') diff --git a/server/store/store.go b/server/store/store.go index 4863ff0..b620e6d 100644 --- a/server/store/store.go +++ b/server/store/store.go @@ -9,7 +9,6 @@ import ( "github.com/nsheridan/cashier/lib" "github.com/nsheridan/cashier/server/config" - "github.com/nsheridan/cashier/server/store/types" ) // New returns a new configured database. @@ -37,12 +36,12 @@ type CertStorer interface { // A CertRecord is a representation of a ssh certificate used by a CertStorer. type CertRecord struct { - KeyID string `json:"key_id" db:"key_id"` - Principals types.StringSlice `json:"principals" db:"principals"` - CreatedAt time.Time `json:"created_at" db:"created_at"` - Expires time.Time `json:"expires" db:"expires_at"` - Revoked bool `json:"revoked" db:"revoked"` - Raw string `json:"-" db:"raw_key"` + KeyID string `json:"key_id" db:"key_id"` + Principals StringSlice `json:"principals" db:"principals"` + CreatedAt time.Time `json:"created_at" db:"created_at"` + Expires time.Time `json:"expires" db:"expires_at"` + Revoked bool `json:"revoked" db:"revoked"` + Raw string `json:"-" db:"raw_key"` } // MarshalJSON implements the json.Marshaler interface for the CreatedAt and @@ -69,7 +68,7 @@ func parseTime(t uint64) time.Time { func parseCertificate(cert *ssh.Certificate) *CertRecord { return &CertRecord{ KeyID: cert.KeyId, - Principals: types.StringSlice(cert.ValidPrincipals), + Principals: StringSlice(cert.ValidPrincipals), CreatedAt: parseTime(cert.ValidAfter), Expires: parseTime(cert.ValidBefore), Raw: string(lib.GetPublicKey(cert)), -- cgit v1.2.3