Documentation
¶
Index ¶
- Constants
- Variables
- func GetFsckFunc(ctx context.Context) store.FsckCallback
- 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 IsCheckRecipients(ctx context.Context) bool
- func IsFsckCheck(ctx context.Context) bool
- func IsFsckDecrypt(ctx context.Context) bool
- func IsFsckForce(ctx context.Context) bool
- func IsNoGitOps(ctx context.Context) bool
- func IsPubkeyUpdate(ctx context.Context) bool
- func WithCheckRecipients(ctx context.Context, cr bool) context.Context
- func WithFsckCheck(ctx context.Context, check bool) context.Context
- func WithFsckDecrypt(ctx context.Context, d bool) context.Context
- func WithFsckForce(ctx context.Context, force bool) context.Context
- func WithFsckFunc(ctx context.Context, imf store.FsckCallback) context.Context
- func WithNoGitOps(ctx context.Context, d bool) context.Context
- func WithPubkeyUpdate(ctx context.Context, d bool) context.Context
- type ErrorSeverity
- type InvalidRecipientsError
- type Store
- func (s *Store) AddRecipient(ctx context.Context, id string) error
- func (s *Store) Alias() string
- func (s *Store) CheckRecipients(ctx context.Context) error
- func (s *Store) Concurrency() int
- func (s *Store) Convert(ctx context.Context, cryptoBe backend.CryptoBackend, ...) error
- func (s *Store) Copy(ctx context.Context, from, to string) error
- func (s *Store) Crypto() backend.Crypto
- func (s *Store) Delete(ctx context.Context, name string) error
- func (s *Store) Equals(other *Store) bool
- func (s *Store) Exists(ctx context.Context, name string) bool
- func (s *Store) Fsck(ctx context.Context, path string) error
- func (s *Store) Get(ctx context.Context, name string) (gopass.Secret, error)
- func (s *Store) GetRecipients(ctx context.Context, name string) (*recipients.Recipients, error)
- func (s *Store) GetRevision(ctx context.Context, name, revision string) (gopass.Secret, error)
- func (s *Store) GetTemplate(ctx context.Context, name string) ([]byte, error)
- func (s *Store) GitInit(ctx context.Context) error
- func (s *Store) GitStatus(ctx context.Context, _ string) error
- func (s *Store) HasTemplate(ctx context.Context, name string) bool
- func (s *Store) ImportMissingPublicKeys(ctx context.Context, newrs ...string) error
- func (s *Store) Init(ctx context.Context, path string, ids ...string) error
- func (s *Store) IsDir(ctx context.Context, name string) bool
- func (s *Store) IsInitialized(ctx context.Context) bool
- func (s *Store) Link(ctx context.Context, from, to string) error
- func (s *Store) List(ctx context.Context, prefix string) ([]string, error)
- func (s *Store) ListRevisions(ctx context.Context, name string) ([]backend.Revision, error)
- func (s *Store) ListTemplates(ctx context.Context, prefix string) []string
- func (s *Store) Lock() error
- func (s *Store) LookupTemplate(ctx context.Context, name string) (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) Passfile(name string) 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) RecipientsTree(ctx context.Context) map[string][]string
- func (s *Store) RemoveRecipient(ctx context.Context, key string) error
- func (s *Store) RemoveTemplate(ctx context.Context, name string) error
- func (s *Store) SaveRecipients(ctx context.Context, ack bool) error
- func (s *Store) Set(ctx context.Context, name string, sec gopass.Byter) error
- func (s *Store) SetRecipients(ctx context.Context, rs *recipients.Recipients) error
- func (s *Store) SetTemplate(ctx context.Context, name string, content []byte) error
- func (s *Store) Storage() backend.Storage
- func (s *Store) String() string
- func (s *Store) TemplateTree(ctx context.Context) *tree.Root
- func (s *Store) UpdateExportedPublicKeys(ctx context.Context, rs []string) (bool, error)
- func (s *Store) Valid() bool
Constants ¶
const (
// TemplateFile is the name of a pass template.
TemplateFile = ".pass-template"
)
Variables ¶
var ErrInvalidHash = fmt.Errorf("recipients.hash invalid")
ErrInvalidHash indicates an outdated value of `recipients.hash`.
var Sep = "/"
Sep is the separator used in lists to separate folders from entries.
Functions ¶
func GetFsckFunc ¶
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 HasCheckRecipients ¶
HasCheckRecipients returns true if check recipients has been set in this context.
func HasFsckCheck ¶
HasFsckCheck returns true if a value for fsck check has been set in this context.
func HasFsckForce ¶
HasFsckForce returns true if a value for fsck force has been set in this context.
func HasFsckFunc ¶
HasFsckFunc returns true if a fsck func has been set in this context.
func IsCheckRecipients ¶
IsCheckRecipients will return the value of the check recipients flag or the default value (false).
func IsFsckCheck ¶
IsFsckCheck returns the value of fsck check.
func IsFsckDecrypt ¶
IsFsckDecrypt will return the value for the decrypt during fsck, defaulting to false.
func IsFsckForce ¶
IsFsckForce returns the value of fsck force.
func IsNoGitOps ¶
IsNoGitOps returns the value for NoGitOps from the context or the default (false).
func IsPubkeyUpdate ¶ added in v1.14.10
IsPubkeyUpdate returns true if we should update all exported recipients pub keys.
func WithCheckRecipients ¶
WithCheckRecipients will return a context with the flag for check recipients set.
func WithFsckCheck ¶
WithFsckCheck returns a context with the flag for fscks check set.
func WithFsckDecrypt ¶
WithFsckDecrypt will return a context with the value for the decrypt during fsck flag set.
func WithFsckForce ¶
WithFsckForce returns a context with the flag for fsck force set.
func WithFsckFunc ¶
WithFsckFunc will return a context with the fsck confirmation callback set.
func WithNoGitOps ¶
WithNoGitOps returns a context with the value for NoGitOps set. This will skip any git operations in concurrent goroutines.
Types ¶
type ErrorSeverity ¶ added in v1.15.3
type ErrorSeverity int
ErrorSeverity provides a way for a function to specify how severe of an error it experienced.
func (ErrorSeverity) String ¶ added in v1.15.3
func (e ErrorSeverity) String() string
type InvalidRecipientsError ¶ added in v1.15.3
InvalidRecipientsError is a custom error type that contains a list of invalid recipients with their check failures.
func (InvalidRecipientsError) Error ¶ added in v1.15.3
func (e InvalidRecipientsError) Error() string
func (InvalidRecipientsError) IsError ¶ added in v1.15.3
func (e InvalidRecipientsError) IsError() bool
IsError returns true if this multi error contains any underlying errors.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a password store.
func (*Store) AddRecipient ¶
AddRecipient adds a new recipient to the list.
func (*Store) CheckRecipients ¶ added in v1.15.3
CheckRecipients makes sure all existing recipients are valid.
func (*Store) Concurrency ¶ added in v1.14.0
Concurrency returns the number of concurrent operations allowed by this stores crypto implementation (e.g. usually 1 for GPG).
func (*Store) Convert ¶
func (s *Store) Convert(ctx context.Context, cryptoBe backend.CryptoBackend, storageBe backend.StorageBackend, move bool) error
Convert will convert an existing store to a new store with possibly different set of crypto and storage backends. Please note that it will happily convert to the same set of backends if requested.
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) GetRecipients ¶
func (s *Store) GetRecipients(ctx context.Context, name string) (*recipients.Recipients, error)
GetRecipients will load all Recipients from the .gpg-id file for the given secret path.
func (*Store) GetRevision ¶
GetRevision will retrieve a single revision from the backend.
func (*Store) GetTemplate ¶
GetTemplate will return the content of the named template.
func (*Store) HasTemplate ¶
HasTemplate returns true if the template exists.
func (*Store) ImportMissingPublicKeys ¶
ImportMissingPublicKeys will try to import any missing public keys from the .public-keys folder in the password store.
func (*Store) IsInitialized ¶
IsInitialized returns true if the store is properly initialized.
func (*Store) ListRevisions ¶
ListRevisions will list all revisions for a secret.
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. 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 ¶
OurKeyID returns the key fingprint this user can use to access the store (if any).
func (*Store) Passfile ¶ added in v1.14.1
Passfile returns the name of gpg file on disk, for the given key/name.
func (*Store) Recipients ¶
Recipients returns the list of recipients of this store.
func (*Store) RecipientsTree ¶
RecipientsTree returns a mapping of secrets to recipients. Note: Usually that is one set of recipients per store, but we offer limited support of different recipients per sub-directory so this is why we are here.
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 ¶
SaveRecipients persists the current recipients on disk. Setting ack to true will acknowledge an invalid hash and allow updating it.
func (*Store) SetRecipients ¶
func (s *Store) SetRecipients(ctx context.Context, rs *recipients.Recipients) error
SetRecipients will update the stored recipients.
func (*Store) SetTemplate ¶
SetTemplate will (over)write the content to the template file.
func (*Store) TemplateTree ¶
TemplateTree returns a tree of all templates.
func (*Store) UpdateExportedPublicKeys ¶ added in v1.14.6
UpdateExportedPublicKeys will export any possibly missing public keys to the stores .public-keys directory.