Documentation
¶
Index ¶
- Variables
- func NewPasswordSecretName(profileName string) (string, error)
- func ValidateName(name string) (string, error)
- func ValidateUsername(username string) (string, error)
- type Profile
- type Store
- func (s *Store) Delete(name string) error
- func (s *Store) Err() error
- func (s *Store) Get(name string) (*Profile, error)
- func (s *Store) List() []string
- func (s *Store) ListProfiles() []*Profile
- func (s *Store) ReloadSecrets() error
- func (s *Store) SecretStorePath() string
- func (s *Store) Set(p *Profile) error
- func (s *Store) SetReference(name, username, secretName string) error
Constants ¶
This section is empty.
Variables ¶
var ErrLegacyPlaintext = errors.New("legacy plaintext credential requires re-save")
Functions ¶
func NewPasswordSecretName ¶ added in v0.9.0
NewPasswordSecretName returns a unique opaque encrypted-store key.
func ValidateName ¶ added in v0.9.0
func ValidateUsername ¶ added in v0.9.0
Types ¶
type Profile ¶
type Profile struct {
Name string `json:"name"`
Username string `json:"username"`
Password string `json:"-"`
PasswordSecret string `json:"password_secret,omitempty"`
RequiresResave bool `json:"requires_resave,omitempty"`
}
Profile stores credential metadata. Password is populated only on Get and is never serialized to credentials.json.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages credential metadata and an encrypted password store.
func LoadStore ¶
func LoadStore(filePath string, encrypted ...*secretstore.Store) *Store
LoadStore reads credential metadata from disk. Passwords are stored in a separate encrypted store beside credentials.json.
func (*Store) ListProfiles ¶ added in v0.9.0
ListProfiles returns credential metadata without passwords.
func (*Store) ReloadSecrets ¶ added in v0.9.0
ReloadSecrets refreshes encrypted passwords written by the prompt helper.
func (*Store) SecretStorePath ¶ added in v0.9.0
SecretStorePath returns the encrypted password-store path.
func (*Store) SetReference ¶ added in v0.9.0
SetReference commits metadata for a password already written by the local prompt helper. The referenced encrypted value must exist.