gopass: github.com/justwatchcom/gopass/pkg/store/sub Index | Files

package sub

import "github.com/justwatchcom/gopass/pkg/store/sub"

Index

Package Files

context.go crypto.go fsck.go git.go gpg.go init.go list.go move.go rcs.go read.go recipients.go storage.go store.go templates.go write.go

Constants

const (
    // TemplateFile is the name of a pass template
    TemplateFile = ".pass-template"
)

Variables

var (
    // ErrRecipientChecksumChanged is returned is the recipient checksum has changed
    ErrRecipientChecksumChanged = fmt.Errorf("checksum changed. Run 'gopass recipients update' to get rid of this warning")
)

func GetCryptoBackend Uses

func GetCryptoBackend(ctx context.Context, cb backend.CryptoBackend, cfgdir string, agent *client.Client) (backend.Crypto, error)

GetCryptoBackend initialized the correct crypto backend

func GetFsckFunc Uses

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 Uses

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 GetReason Uses

func GetReason(ctx context.Context) string

GetReason returns the value of reason

func GetRecipientFunc Uses

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 Uses

func HasAutoSync(ctx context.Context) bool

HasAutoSync has been set if a value for auto sync has been set in this context

func HasCheckRecipients Uses

func HasCheckRecipients(ctx context.Context) bool

HasCheckRecipients returns true if check recipients has been set in this context

func HasFsckCheck Uses

func HasFsckCheck(ctx context.Context) bool

HasFsckCheck returns true if a value for fsck check has been set in this context

func HasFsckForce Uses

func HasFsckForce(ctx context.Context) bool

HasFsckForce returns true if a value for fsck force has been set in this context

func HasFsckFunc Uses

func HasFsckFunc(ctx context.Context) bool

HasFsckFunc returns true if a fsck func has been set in this context

func HasImportFunc Uses

func HasImportFunc(ctx context.Context) bool

HasImportFunc returns true if a value for import func has been set in this context

func HasReason Uses

func HasReason(ctx context.Context) bool

HasReason returns true if a value for reason has been set in this context

func HasRecipientFunc Uses

func HasRecipientFunc(ctx context.Context) bool

HasRecipientFunc returns true if a recipient func has been set in this context

func IsAutoSync Uses

func IsAutoSync(ctx context.Context) bool

IsAutoSync returns the value of autosync

func IsCheckRecipients Uses

func IsCheckRecipients(ctx context.Context) bool

IsCheckRecipients will return the value of the check recipients flag or the default value (false)

func IsFsckCheck Uses

func IsFsckCheck(ctx context.Context) bool

IsFsckCheck returns the value of fsck check

func IsFsckForce Uses

func IsFsckForce(ctx context.Context) bool

IsFsckForce returns the value of fsck force

func WithAutoSync Uses

func WithAutoSync(ctx context.Context, sync bool) context.Context

WithAutoSync returns a context with the flag for autosync set

func WithCheckRecipients Uses

func WithCheckRecipients(ctx context.Context, cr bool) context.Context

WithCheckRecipients will return a context with the flag for check recipients set

func WithFsckCheck Uses

func WithFsckCheck(ctx context.Context, check bool) context.Context

WithFsckCheck returns a context with the flag for fscks check set

func WithFsckForce Uses

func WithFsckForce(ctx context.Context, force bool) context.Context

WithFsckForce returns a context with the flag for fsck force set

func WithFsckFunc Uses

func WithFsckFunc(ctx context.Context, imf store.FsckCallback) context.Context

WithFsckFunc will return a context with the fsck confirmation callback set

func WithImportFunc Uses

func WithImportFunc(ctx context.Context, imf store.ImportCallback) context.Context

WithImportFunc will return a context with the import callback set

func WithReason Uses

func WithReason(ctx context.Context, msg string) context.Context

WithReason returns a context with a commit/change reason set

func WithRecipientFunc Uses

func WithRecipientFunc(ctx context.Context, imf store.RecipientCallback) context.Context

WithRecipientFunc will return a context with the recipient callback set

type Store Uses

type Store struct {
    // contains filtered or unexported fields
}

Store is password store

func New Uses

func New(ctx context.Context, sc recipientHashStorer, alias string, u *backend.URL, cfgdir string, agent *client.Client) (*Store, error)

New creates a new store, copying settings from the given root store

func (*Store) AddRecipient Uses

func (s *Store) AddRecipient(ctx context.Context, id string) error

AddRecipient adds a new recipient to the list

func (*Store) Alias Uses

func (s *Store) Alias() string

Alias returns the value of alias

func (*Store) Copy Uses

func (s *Store) Copy(ctx context.Context, from, to string) error

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) Crypto Uses

func (s *Store) Crypto() backend.Crypto

Crypto returns the crypto backend

func (*Store) Delete Uses

func (s *Store) Delete(ctx context.Context, name string) error

Delete will remove an single entry from the store

func (*Store) Equals Uses

func (s *Store) Equals(other store.Store) bool

Equals returns true if this.storage has the same on-disk path as the other

func (*Store) Exists Uses

func (s *Store) Exists(ctx context.Context, name string) bool

Exists checks the existence of a single entry

func (*Store) ExportMissingPublicKeys Uses

func (s *Store) ExportMissingPublicKeys(ctx context.Context, rs []string) (bool, error)

ExportMissingPublicKeys will export any possibly missing public keys to the stores .public-keys directory

func (*Store) Fsck Uses

func (s *Store) Fsck(ctx context.Context, path string) error

Fsck checks all entries matching the given prefix

func (*Store) Get Uses

func (s *Store) Get(ctx context.Context, name string) (store.Secret, error)

Get returns the plaintext of a single key

func (*Store) GetRecipients Uses

func (s *Store) GetRecipients(ctx context.Context, name string) ([]string, error)

GetRecipients will load all Recipients from the .gpg-id file for the given secret path

func (*Store) GetRevision Uses

func (s *Store) GetRevision(ctx context.Context, name, revision string) (store.Secret, error)

GetRevision will retrieve a single revision from the backend

func (*Store) GetTemplate Uses

func (s *Store) GetTemplate(ctx context.Context, name string) ([]byte, error)

GetTemplate will return the content of the named template

func (*Store) GitInit Uses

func (s *Store) GitInit(ctx context.Context, un, ue string) error

GitInit initializes the the git repo in the store

func (*Store) HasTemplate Uses

func (s *Store) HasTemplate(ctx context.Context, name string) bool

HasTemplate returns true if the template exists

func (*Store) ImportMissingPublicKeys Uses

func (s *Store) ImportMissingPublicKeys(ctx context.Context) error

ImportMissingPublicKeys will try to import any missing public keys from the .gpg-keys folder in the password store

func (*Store) Init Uses

func (s *Store) Init(ctx context.Context, path string, ids ...string) error

Init tries to initialize a new password store location matching the object

func (*Store) Initialized Uses

func (s *Store) Initialized(ctx context.Context) bool

Initialized returns true if the store is properly initialized

func (*Store) IsDir Uses

func (s *Store) IsDir(ctx context.Context, name string) bool

IsDir returns true if the entry is folder inside the store

func (*Store) List Uses

func (s *Store) List(ctx context.Context, prefix string) ([]string, error)

List will list all entries in this store

func (*Store) ListRevisions Uses

func (s *Store) ListRevisions(ctx context.Context, name string) ([]backend.Revision, error)

ListRevisions will list all revisions for a secret

func (*Store) ListTemplates Uses

func (s *Store) ListTemplates(ctx context.Context, prefix string) []string

ListTemplates will list all templates in this store

func (*Store) LookupTemplate Uses

func (s *Store) LookupTemplate(ctx context.Context, name string) (string, []byte, bool)

LookupTemplate will lookup and return a template

func (*Store) Move Uses

func (s *Store) Move(ctx context.Context, from, to string) error

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 Uses

func (s *Store) OurKeyID(ctx context.Context) string

OurKeyID returns the key fingprint this user can use to access the store (if any)

func (*Store) Path Uses

func (s *Store) Path() string

Path returns the value of path

func (*Store) Prune Uses

func (s *Store) Prune(ctx context.Context, tree string) error

Prune will remove a subtree from the Store

func (*Store) RCS Uses

func (s *Store) RCS() backend.RCS

RCS returns the sync backend

func (*Store) Recipients Uses

func (s *Store) Recipients(ctx context.Context) []string

Recipients returns the list of recipients of this store

func (*Store) RemoveRecipient Uses

func (s *Store) RemoveRecipient(ctx context.Context, id string) error

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 Uses

func (s *Store) RemoveTemplate(ctx context.Context, name string) error

RemoveTemplate will delete the named template if it exists

func (*Store) SaveRecipients Uses

func (s *Store) SaveRecipients(ctx context.Context) error

SaveRecipients persists the current recipients on disk

func (*Store) Set Uses

func (s *Store) Set(ctx context.Context, name string, sec store.Secret) error

Set encodes and writes the cipertext of one entry to disk

func (*Store) SetRecipients Uses

func (s *Store) SetRecipients(ctx context.Context, rs []string) error

SetRecipients will update the stored recipients and the associated checksum

func (*Store) SetTemplate Uses

func (s *Store) SetTemplate(ctx context.Context, name string, content []byte) error

SetTemplate will (over)write the content to the template file

func (*Store) Storage Uses

func (s *Store) Storage() backend.Storage

Storage returns the storage backend used by this.storage

func (*Store) String Uses

func (s *Store) String() string

String implement fmt.Stringer

func (*Store) TemplateTree Uses

func (s *Store) TemplateTree(ctx context.Context) (tree.Tree, error)

TemplateTree returns a tree of all templates

func (*Store) URL Uses

func (s *Store) URL() string

URL returns the store URL

func (*Store) Valid Uses

func (s *Store) Valid() bool

Valid returns true if this store is not nil

Package sub imports 23 packages (graph). Updated 2019-09-22. Refresh now. Tools for package owners.