Documentation ¶
Index ¶
- Variables
- type FsckCallback
- type ImportCallback
- type RecipientCallback
- type RootStore
- func (r *RootStore) AddMount(alias, path string, keys ...string) error
- func (r *RootStore) AddRecipient(store, rec string) error
- func (r *RootStore) Copy(from, to string) error
- func (r *RootStore) Delete(name string) error
- func (r *RootStore) Exists(name string) (bool, error)
- func (r *RootStore) Format() (string, error)
- func (r *RootStore) Fsck(check, force bool) error
- func (r *RootStore) Get(name string) ([]byte, error)
- func (r *RootStore) Git(store string, args ...string) error
- func (r *RootStore) GitInit(store, sk string) error
- func (r *RootStore) Init(store string, ids ...string) error
- func (r *RootStore) Initialized() bool
- func (r *RootStore) IsDir(name string) bool
- func (r *RootStore) List() ([]string, error)
- func (r *RootStore) ListRecipients(store string) []string
- func (r *RootStore) Move(from, to string) error
- func (r *RootStore) Prune(tree string) error
- func (r *RootStore) RecipientsTree(pretty bool) (*tree.Folder, error)
- func (r *RootStore) RemoveMount(alias string) error
- func (r *RootStore) RemoveRecipient(store, rec string) error
- func (r *RootStore) Set(name string, content []byte) error
- func (r *RootStore) SetConfirm(name string, content []byte, cb RecipientCallback) error
- func (r *RootStore) String() string
- func (r *RootStore) Tree() (*tree.Folder, error)
- func (r *RootStore) UnmarshalJSON(b []byte) error
- type Store
- func (s *Store) AddRecipient(id string) error
- func (s *Store) Copy(from, to string) error
- func (s *Store) Delete(name string) error
- func (s *Store) Exists(name string) (bool, error)
- func (s *Store) Fsck(check, force bool) error
- func (s *Store) Get(name string) ([]byte, error)
- func (s *Store) Git(args ...string) error
- func (s *Store) GitInit(signKey string) error
- func (s *Store) Init(ids ...string) error
- func (s *Store) Initialized() bool
- func (s *Store) IsDir(name string) bool
- func (s *Store) List(prefix string) ([]string, error)
- func (s *Store) Move(from, to string) error
- func (s *Store) Prune(tree string) error
- func (s *Store) RemoveRecipient(id string) error
- func (s *Store) Set(name string, content []byte) error
- func (s *Store) SetConfirm(name string, content []byte, cb RecipientCallback) error
- func (s *Store) String() string
Constants ¶
This section is empty.
Variables ¶
var ( // ErrGitInit is returned if git is already initialized ErrGitInit = fmt.Errorf("git is already initialized") // ErrGitNotInit is returned if git is not initialized ErrGitNotInit = fmt.Errorf("git is not initialized") // ErrGitNoRemote is returned if git has no origin remote ErrGitNoRemote = fmt.Errorf("git has no remote origin") )
var ( // ErrExistsFailed is returend if we can't check for existence ErrExistsFailed = fmt.Errorf("Failed to check for existence") // ErrNotFound is returned if an entry was not found ErrNotFound = fmt.Errorf("Entry is not in the password store") // ErrEncrypt is returned if we failed to encrypt an entry ErrEncrypt = fmt.Errorf("Failed to encrypt") // ErrDecrypt is returned if we failed to decrypt and entry ErrDecrypt = fmt.Errorf("Failed to decrypt") // ErrSneaky is returned if the user passes a possible malicious path to gopass ErrSneaky = fmt.Errorf("you've attempted to pass a sneaky path to gopass. go home") )
Functions ¶
This section is empty.
Types ¶
type FsckCallback ¶
FsckCallback is a callback to ask the user to confirm certain fsck corrective actions
type ImportCallback ¶
ImportCallback is a callback to ask the user if he wants to import a certain recipients public key into his keystore
type RecipientCallback ¶
RecipientCallback is a callback to verify the list of recipients
type RootStore ¶
type RootStore struct { AutoPush bool `json:"autopush"` // push to git remote after commit AutoPull bool `json:"autopull"` // pull from git before push AutoImport bool `json:"autoimport"` // import missing public keys w/o asking AlwaysTrust bool `json:"alwaystrust"` // always trust public keys when encrypting NoConfirm bool `json:"noconfirm"` // do not confirm recipients when encrypting PersistKeys bool `json:"persistkeys"` // store recipient keys in store LoadKeys bool `json:"loadkeys"` // load missing keys from store ClipTimeout int `json:"cliptimeout"` // clear clipboard after seconds Path string `json:"path"` // path to the root store Mount map[string]string `json:"mounts,omitempty"` Version string `json:"version"` ImportFunc ImportCallback `json:"-"` FsckFunc FsckCallback `json:"-"` // contains filtered or unexported fields }
RootStore is the public facing password store
func NewRootStore ¶
NewRootStore creates a new store
func (*RootStore) AddRecipient ¶
AddRecipient adds a single recipient to the given store
func (*RootStore) Copy ¶
Copy will copy one entry to another location. Multi-store copies are supported. Each entry has to be decoded and encoded for the destination to make sure it's encrypted for the right set of recipients.
func (*RootStore) Initialized ¶
Initialized checks on disk if .gpg-id was generated and thus returns true.
func (*RootStore) ListRecipients ¶
ListRecipients lists all recipients for the given store
func (*RootStore) Move ¶
Move will move one entry from one location to another. Cross-store moves are supported. Moving an entry will decode it from the old location, encode it for the destination store with the right set of recipients and remove it from the old location afterwards.
func (*RootStore) RecipientsTree ¶
RecipientsTree returns a tree view of all stores' recipients
func (*RootStore) RemoveMount ¶
RemoveMount removes and existing mount
func (*RootStore) RemoveRecipient ¶
RemoveRecipient removes a single recipient from the given store
func (*RootStore) SetConfirm ¶
func (r *RootStore) SetConfirm(name string, content []byte, cb RecipientCallback) error
SetConfirm calls Set with confirmation callback
func (*RootStore) UnmarshalJSON ¶
UnmarshalJSON implements a custom JSON unmarshaler that will also make sure the store is properly initialized after loading
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is password store
func (*Store) AddRecipient ¶
AddRecipient adds a new recipient to the list
func (*Store) Copy ¶
Copy will copy one entry to another location. Multi-store copies are supported. Each entry has to be decoded and encoded for the destination to make sure it's encrypted for the right set of recipients.
func (*Store) GitInit ¶
GitInit initializes this store's git repo and recursively calls GitInit on all substores.
func (*Store) Initialized ¶
Initialized returns true if the store is properly initialized
func (*Store) Move ¶
Move will move one entry from one location to another. Cross-store moves are supported. Moving an entry will decode it from the old location, encode it for the destination store with the right set of recipients and remove it from the old location afterwards.
func (*Store) RemoveRecipient ¶
RemoveRecipient will remove the given recipient from the store
func (*Store) SetConfirm ¶
func (s *Store) SetConfirm(name string, content []byte, cb RecipientCallback) error
SetConfirm encodes and writes the cipertext of one entry to disk. This method can be passed a callback to confirm the recipients immedeately before encryption.