Implemented encryption functionality of spc and password generation; refactors on spc and server

This commit is contained in:
mitchell 2019-05-22 08:22:40 -07:00
parent c289eecd54
commit cd24f6e848
26 changed files with 1151 additions and 1522 deletions

View file

@ -4,11 +4,13 @@ import (
"time"
)
const TypePrefixCred = "cred"
type Credential struct {
Metadata
Username string
Email string
Password string
Password string `json:"-"`
}
type CredentialInput struct {
@ -25,10 +27,12 @@ type Metadata struct {
UpdatedAt time.Time
Primary string
LoginURL string
Tag string
}
type MetadataInput struct {
Primary string
SourceHost string
LoginURL string
Tag string
}

View file

@ -18,3 +18,13 @@ type CredentialRepo interface {
Delete(ctx context.Context, id string) (err error)
DumpDB(ctx context.Context) (bs []byte, err error)
}
type CredentialClientInit func(ctx context.Context, target, ca, cert, key string) (c CredentialClient, err error)
type CredentialClient interface {
GetAllMetadata(ctx context.Context, sourceHost string) (output <-chan Metadata, errch chan error)
Get(ctx context.Context, id string) (output Credential, err error)
Create(ctx context.Context, ci CredentialInput) (output Credential, err error)
Update(ctx context.Context, id string, ci CredentialInput) (output Credential, err error)
Delete(ctx context.Context, id string) (err error)
}