sub

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GPGID is the name of the file containing the recipient ids
	GPGID = ".gpg-id"
)
View Source
const (
	// TemplateFile is the name of a pass template
	TemplateFile = ".pass-template"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is password store

func New

func New(alias string, cfg *config.Config) (*Store, error)

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

func (*Store) AddRecipient

func (s *Store) AddRecipient(id string) error

AddRecipient adds a new recipient to the list

func (*Store) Alias

func (s *Store) Alias() string

Alias returns the value of alias

func (*Store) Config

func (s *Store) Config() *config.Config

Config returns this sub stores config as a config struct

func (*Store) Copy

func (s *Store) Copy(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) Delete

func (s *Store) Delete(name string) error

Delete will remove an single entry from the store

func (*Store) DeleteKey

func (s *Store) DeleteKey(name, key string) error

DeleteKey will delete a single key in a YAML structured secret

func (*Store) Equals

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

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

func (*Store) Exists

func (s *Store) Exists(name string) bool

Exists checks the existence of a single entry

func (*Store) Fsck

func (s *Store) Fsck(prefix string, check, force bool) (map[string]uint64, error)

Fsck checks this stores integrity

func (*Store) GPGVersion added in v1.3.0

func (s *Store) GPGVersion() semver.Version

GPGVersion returns parsed GPG version information

func (*Store) Get

func (s *Store) Get(name string) ([]byte, error)

Get returns the plaintext of a single key

func (*Store) GetBody

func (s *Store) GetBody(name string) ([]byte, error)

GetBody returns everything but the first line

func (*Store) GetFirstLine

func (s *Store) GetFirstLine(name string) ([]byte, error)

GetFirstLine returns the first line of the plaintext of a single key

func (*Store) GetKey

func (s *Store) GetKey(name, key string) ([]byte, error)

GetKey returns a single key from a structured secret

func (*Store) GetTemplate

func (s *Store) GetTemplate(name string) ([]byte, error)

GetTemplate will return the content of the named template

func (*Store) Git

func (s *Store) Git(args ...string) error

Git runs arbitrary git commands on this store

func (*Store) GitInit

func (s *Store) GitInit(alias, signKey, userName, userEmail string) error

GitInit initializes this store's git repo and recursively calls GitInit on all substores.

func (*Store) GitVersion added in v1.3.0

func (s *Store) GitVersion() semver.Version

GitVersion returns the git version as major, minor and patch level

func (*Store) HasTemplate

func (s *Store) HasTemplate(name string) bool

HasTemplate returns true if the template exists

func (*Store) ImportMissingPublicKeys added in v1.3.0

func (s *Store) ImportMissingPublicKeys() error

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

func (*Store) Init

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

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

func (*Store) Initialized

func (s *Store) Initialized() bool

Initialized returns true if the store is properly initialized

func (*Store) IsDir

func (s *Store) IsDir(name string) bool

IsDir returns true if the entry is folder inside the store

func (*Store) List

func (s *Store) List(prefix string) ([]string, error)

List will list all entries in this store

func (*Store) ListTemplates

func (s *Store) ListTemplates(prefix string) []string

ListTemplates will list all templates in this store

func (*Store) LookupTemplate

func (s *Store) LookupTemplate(name string) ([]byte, bool)

LookupTemplate will lookup and return a template

func (*Store) Move

func (s *Store) Move(from, to string) error

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) Path

func (s *Store) Path() string

Path returns the value of path

func (*Store) Prune

func (s *Store) Prune(tree string) error

Prune will remove a subtree from the Store

func (*Store) Recipients

func (s *Store) Recipients() []string

Recipients returns the list of recipients of this store

func (*Store) RemoveRecipient

func (s *Store) RemoveRecipient(id string) error

RemoveRecipient will remove the given recipient from the storefunc (s *Store) RemoveRecipient()id string) error {

func (*Store) RemoveTemplate

func (s *Store) RemoveTemplate(name string) error

RemoveTemplate will delete the named template if it exists

func (*Store) SaveRecipients added in v1.3.0

func (s *Store) SaveRecipients() error

SaveRecipients persists the current recipients on disk

func (*Store) Set

func (s *Store) Set(name string, content []byte, reason string) error

Set encodes and write the ciphertext of one entry to disk

func (*Store) SetConfirm

func (s *Store) SetConfirm(name string, content []byte, reason string, cb store.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.

func (*Store) SetKey

func (s *Store) SetKey(name, key, value string) error

SetKey will update a single key in a YAML structured secret

func (*Store) SetPassword added in v1.3.0

func (s *Store) SetPassword(name string, password []byte) error

SetPassword update a password in an already existing entry on the disk

func (*Store) SetTemplate

func (s *Store) SetTemplate(name string, content []byte) error

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

func (*Store) String

func (s *Store) String() string

String implement fmt.Stringer

func (*Store) TemplateTree

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

TemplateTree returns a tree of all templates

func (*Store) UpdateConfig

func (s *Store) UpdateConfig(cfg *config.Config) error

UpdateConfig updates this sub-stores internal config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL