Documentation ¶
Index ¶
- Constants
- func GetFsckFunc(ctx context.Context) store.FsckCallback
- func GetImportFunc(ctx context.Context) store.ImportCallback
- func GetReason(ctx context.Context) string
- func GetRecipientFunc(ctx context.Context) store.RecipientCallback
- func HasAutoSync(ctx context.Context) bool
- func HasCheckRecipients(ctx context.Context) bool
- func HasFsckCheck(ctx context.Context) bool
- func HasFsckForce(ctx context.Context) bool
- func HasFsckFunc(ctx context.Context) bool
- func HasImportFunc(ctx context.Context) bool
- func HasReason(ctx context.Context) bool
- func HasRecipientFunc(ctx context.Context) bool
- func IsAutoSync(ctx context.Context) bool
- func IsCheckRecipients(ctx context.Context) bool
- func IsFsckCheck(ctx context.Context) bool
- func IsFsckForce(ctx context.Context) bool
- func WithAutoSync(ctx context.Context, sync bool) context.Context
- func WithCheckRecipients(ctx context.Context, cr bool) context.Context
- func WithFsckCheck(ctx context.Context, check bool) context.Context
- func WithFsckForce(ctx context.Context, force bool) context.Context
- func WithFsckFunc(ctx context.Context, imf store.FsckCallback) context.Context
- func WithImportFunc(ctx context.Context, imf store.ImportCallback) context.Context
- func WithReason(ctx context.Context, msg string) context.Context
- func WithRecipientFunc(ctx context.Context, imf store.RecipientCallback) context.Context
- type Store
- func (s *Store) AddRecipient(ctx context.Context, id string) error
- func (s *Store) Alias() string
- func (s *Store) Copy(ctx context.Context, from, to string) error
- func (s *Store) Delete(ctx context.Context, name string) error
- func (s *Store) Equals(other *Store) bool
- func (s *Store) Exists(name string) bool
- func (s *Store) ExportMissingPublicKeys(ctx context.Context, rs []string) (bool, error)
- func (s *Store) Fsck(ctx context.Context, prefix string) (map[string]uint64, error)
- func (s *Store) GPGVersion(ctx context.Context) semver.Version
- func (s *Store) Get(ctx context.Context, name string) (*secret.Secret, error)
- func (s *Store) GetRecipients(ctx context.Context, file string) ([]string, error)
- func (s *Store) GetTemplate(name string) ([]byte, error)
- func (s *Store) Git(ctx context.Context, args ...string) error
- func (s *Store) GitInit(ctx context.Context, sk, un, ue string) error
- func (s *Store) GitInitConfig(ctx context.Context, sk, un, ue string) error
- func (s *Store) GitPush(ctx context.Context, origin, branch string) error
- func (s *Store) GitVersion(ctx context.Context) semver.Version
- func (s *Store) HasTemplate(name string) bool
- func (s *Store) ImportMissingPublicKeys(ctx context.Context) error
- func (s *Store) Init(ctx context.Context, path string, 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) ListTemplates(prefix string) []string
- func (s *Store) LookupTemplate(name string) ([]byte, bool)
- func (s *Store) Move(ctx context.Context, from, to string) error
- func (s *Store) OurKeyID(ctx context.Context) string
- func (s *Store) Path() string
- func (s *Store) Prune(ctx context.Context, tree string) error
- func (s *Store) Recipients(ctx context.Context) []string
- func (s *Store) RemoveRecipient(ctx context.Context, id string) error
- func (s *Store) RemoveTemplate(name string) error
- func (s *Store) SaveRecipients(ctx context.Context) error
- func (s *Store) Set(ctx context.Context, name string, sec *secret.Secret) error
- func (s *Store) SetTemplate(name string, content []byte) error
- func (s *Store) String() string
- func (s *Store) TemplateTree() (tree.Tree, error)
Constants ¶
const (
// GPGID is the name of the file containing the recipient ids
GPGID = ".gpg-id"
)
const (
// TemplateFile is the name of a pass template
TemplateFile = ".pass-template"
)
Variables ¶
This section is empty.
Functions ¶
func GetFsckFunc ¶ added in v1.4.0
func GetFsckFunc(ctx context.Context) store.FsckCallback
GetFsckFunc will return the fsck confirmation callback or a default one returning true. Note: will never return nil
func GetImportFunc ¶ added in v1.4.0
func GetImportFunc(ctx context.Context) store.ImportCallback
GetImportFunc will return the import callback or a default one returning true Note: will never return nil
func GetRecipientFunc ¶ added in v1.4.0
func GetRecipientFunc(ctx context.Context) store.RecipientCallback
GetRecipientFunc will return the recipient callback or a default one returning the unaltered list of recipients. Note: will never return nil
func HasAutoSync ¶ added in v1.4.0
HasAutoSync has been set if a value for auto sync has been set in this context
func HasCheckRecipients ¶ added in v1.4.0
HasCheckRecipients returns true if check recipients has been set in this context
func HasFsckCheck ¶ added in v1.4.0
HasFsckCheck returns true if a value for fsck check has been set in this context
func HasFsckForce ¶ added in v1.4.0
HasFsckForce returns true if a value for fsck force has been set in this context
func HasFsckFunc ¶ added in v1.4.0
HasFsckFunc returns true if a fsck func has been set in this context
func HasImportFunc ¶ added in v1.4.0
HasImportFunc returns true if a value for import func has been set in this context
func HasReason ¶ added in v1.4.0
HasReason returns true if a value for reason has been set in this context
func HasRecipientFunc ¶ added in v1.4.0
HasRecipientFunc returns true if a recipient func has been set in this context
func IsAutoSync ¶ added in v1.4.0
IsAutoSync returns the value of autosync
func IsCheckRecipients ¶ added in v1.4.0
IsCheckRecipients will return the value of the check recipients flag or the default value (false)
func IsFsckCheck ¶ added in v1.4.0
IsFsckCheck returns the value of fsck check
func IsFsckForce ¶ added in v1.4.0
IsFsckForce returns the value of fsck force
func WithAutoSync ¶ added in v1.4.0
WithAutoSync returns a context with the flag for autosync set
func WithCheckRecipients ¶ added in v1.4.0
WithCheckRecipients will return a context with the flag for check recipients set
func WithFsckCheck ¶ added in v1.4.0
WithFsckCheck returns a context with the flag for fscks check set
func WithFsckForce ¶ added in v1.4.0
WithFsckForce returns a context with the flag for fsck force set
func WithFsckFunc ¶ added in v1.4.0
WithFsckFunc will return a context with the fsck confirmation callback set
func WithImportFunc ¶ added in v1.4.0
WithImportFunc will return a context with the import callback set
func WithReason ¶ added in v1.4.0
WithReason returns a context with a commit/change reason set
func WithRecipientFunc ¶ added in v1.4.0
WithRecipientFunc will return a context with the recipient callback set
Types ¶
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) ExportMissingPublicKeys ¶ added in v1.4.0
ExportMissingPublicKeys will export any possibly missing public keys to the stores .gpg-keys directory
func (*Store) GPGVersion ¶ added in v1.3.0
GPGVersion returns parsed GPG version information
func (*Store) GetRecipients ¶ added in v1.4.0
GetRecipients will load all Recipients from the .gpg-id file for the given secret path
func (*Store) GetTemplate ¶
GetTemplate will return the content of the named template
func (*Store) GitInitConfig ¶ added in v1.6.0
GitInitConfig (re-)intializes the git config in an existing repo
func (*Store) GitVersion ¶ added in v1.3.0
GitVersion returns the git version
func (*Store) HasTemplate ¶
HasTemplate returns true if the template exists
func (*Store) ImportMissingPublicKeys ¶ added in v1.3.0
ImportMissingPublicKeys will try to import any missing public keys from the .gpg-keys folder in the password store
func (*Store) Initialized ¶
Initialized returns true if the store is properly initialized
func (*Store) ListTemplates ¶
ListTemplates will list all templates in this store
func (*Store) LookupTemplate ¶
LookupTemplate will lookup and return a template
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) OurKeyID ¶ added in v1.6.0
OurKeyID returns the key fingprint this user can use to access the store (if any)
func (*Store) Recipients ¶
Recipients returns the list of recipients of this store
func (*Store) RemoveRecipient ¶
RemoveRecipient will remove the given recipient from the store but if this key is not available on this machine we just try to remove it literally
func (*Store) RemoveTemplate ¶
RemoveTemplate will delete the named template if it exists
func (*Store) SaveRecipients ¶ added in v1.3.0
SaveRecipients persists the current recipients on disk
func (*Store) Set ¶
Set encodes and writes the cipertext of one entry to disk. This method can be passed a callback to confirm the recipients immediately before encryption.
func (*Store) SetTemplate ¶
SetTemplate will (over)write the content to the template file