mirror of
https://github.com/mitchell/selfpass.git
synced 2025-12-13 21:07:22 +00:00
Implemented encryption functionality of spc and password generation; refactors on spc and server
This commit is contained in:
parent
c289eecd54
commit
cd24f6e848
26 changed files with 1151 additions and 1522 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue