mirror of
https://github.com/mitchell/selfpass.git
synced 2025-12-13 21:07:22 +00:00
Implemented all but update from cli client to server;
solidified encryption; setup deployment mechanism for GCP
This commit is contained in:
parent
cd24f6e848
commit
c5ae0b4ddc
28 changed files with 598 additions and 295 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
@ -8,16 +9,25 @@ const TypePrefixCred = "cred"
|
|||
|
||||
type Credential struct {
|
||||
Metadata
|
||||
Username string
|
||||
Email string
|
||||
Password string `json:"-"`
|
||||
Username string
|
||||
Email string
|
||||
Password string `json:"-"`
|
||||
OTPSecret string `json:"-"`
|
||||
}
|
||||
|
||||
func (c Credential) String() string {
|
||||
return fmt.Sprintf(
|
||||
"username = %s\nemail = %s\n%s",
|
||||
c.Username, c.Email, c.Metadata,
|
||||
)
|
||||
}
|
||||
|
||||
type CredentialInput struct {
|
||||
MetadataInput
|
||||
Username string
|
||||
Email string
|
||||
Password string
|
||||
Username string
|
||||
Email string
|
||||
Password string
|
||||
OTPSecret string
|
||||
}
|
||||
|
||||
type Metadata struct {
|
||||
|
|
@ -30,6 +40,13 @@ type Metadata struct {
|
|||
Tag string
|
||||
}
|
||||
|
||||
func (m Metadata) String() string {
|
||||
return fmt.Sprintf(
|
||||
"id = %s\nsourceHost = %s\ncreatedAt = %s\nupdatedAt = %s\nprimary = %s\nloginUrl = %s\ntag = %s\n",
|
||||
m.ID, m.SourceHost, m.CreatedAt, m.UpdatedAt, m.Primary, m.LoginURL, m.Tag,
|
||||
)
|
||||
}
|
||||
|
||||
type MetadataInput struct {
|
||||
Primary string
|
||||
SourceHost string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue