Changeset 0.28.6 (#192)
This commit is contained in:
@@ -13,24 +13,33 @@ type GitCredential struct {
|
||||
AuthType string `json:"auth_type" db:"auth_type"` // https_pat, https_basic, ssh_key
|
||||
EncryptedData []byte `json:"-" db:"encrypted_data"` // never expose
|
||||
Nonce []byte `json:"-" db:"nonce"` // never expose
|
||||
PublicKey string `json:"public_key,omitempty" db:"public_key"`
|
||||
Fingerprint string `json:"fingerprint,omitempty" db:"fingerprint"`
|
||||
PersonaID *string `json:"persona_id,omitempty" db:"persona_id"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// GitCredentialSummary is the safe-to-expose version (no encrypted data).
|
||||
type GitCredentialSummary struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
AuthType string `json:"auth_type"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
AuthType string `json:"auth_type"`
|
||||
PublicKey string `json:"public_key,omitempty"`
|
||||
Fingerprint string `json:"fingerprint,omitempty"`
|
||||
PersonaID *string `json:"persona_id,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// Summary returns a safe version without encrypted fields.
|
||||
func (c *GitCredential) Summary() GitCredentialSummary {
|
||||
return GitCredentialSummary{
|
||||
ID: c.ID,
|
||||
Name: c.Name,
|
||||
AuthType: c.AuthType,
|
||||
CreatedAt: c.CreatedAt,
|
||||
ID: c.ID,
|
||||
Name: c.Name,
|
||||
AuthType: c.AuthType,
|
||||
PublicKey: c.PublicKey,
|
||||
Fingerprint: c.Fingerprint,
|
||||
PersonaID: c.PersonaID,
|
||||
CreatedAt: c.CreatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user