root

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the public facing password store

func New

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

New creates a new store

func (*Store) AddMount

func (r *Store) AddMount(alias, path string, keys ...string) error

AddMount adds a new mount

func (*Store) AddRecipient

func (r *Store) AddRecipient(store, rec string) error

AddRecipient adds a single recipient to the given store

func (*Store) Alias

func (s *Store) Alias() string

Alias always returns an empty string

func (*Store) AskForMore

func (s *Store) AskForMore() bool

AskForMore returns true if generate should ask for more information

func (*Store) AutoSync added in v1.3.0

func (s *Store) AutoSync() bool

AutoSync returns the value of auto sync

func (*Store) ClipTimeout

func (s *Store) ClipTimeout() int

ClipTimeout returns the value of clip timeout

func (*Store) Config

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

Config returns this root stores config as a config struct

func (*Store) Copy

func (r *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 (r *Store) Delete(name string) error

Delete will remove an single entry from the store

func (*Store) DeleteKey

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

DeleteKey removes a single key

func (*Store) Exists

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

Exists checks the existence of a single entry

func (*Store) Format

func (r *Store) Format(maxDepth int) (string, error)

Format will pretty print all entries in this store and all substores

func (*Store) Fsck

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

Fsck checks the stores integrity

func (*Store) GPGVersion added in v1.3.0

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

GPGVersion returns GPG version information

func (*Store) Get

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

Get returns the plaintext of a single key

func (*Store) GetBody

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

GetBody returns everything but the first line from a key

func (*Store) GetFirstLine

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

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

func (*Store) GetKey

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

GetKey will return a single named entry from a structured document (YAML) in secret name. If no such key exists or yaml decoding fails it will return an error

func (*Store) GetTemplate

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

GetTemplate will return the content of the named template

func (*Store) Git

func (r *Store) Git(name string, recurse, force bool, args ...string) error

Git runs arbitrary git commands on this store and all substores

func (*Store) GitInit

func (r *Store) GitInit(name, sk, userName, userEmail string) error

GitInit initializes the git repo

func (*Store) GitVersion added in v1.3.0

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

GitVersion returns git version information

func (*Store) HasTemplate

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

HasTemplate returns true if the template exists

func (*Store) ImportMissingPublicKeys added in v1.3.0

func (r *Store) ImportMissingPublicKeys() error

ImportMissingPublicKeys import missing public keys in any substore

func (*Store) Init

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

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

func (*Store) Initialized

func (r *Store) Initialized() bool

Initialized checks on disk if .gpg-id was generated and thus returns true.

func (*Store) IsDir

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

IsDir checks if a given key is actually a folder

func (*Store) List

func (r *Store) List(maxDepth int) ([]string, error)

List will return a flattened list of all tree entries

func (*Store) ListRecipients

func (r *Store) ListRecipients(store string) []string

ListRecipients lists all recipients for the given store

func (*Store) LookupTemplate

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

LookupTemplate will lookup and return a template

func (*Store) MountPoints

func (r *Store) MountPoints() []string

MountPoints returns a sorted list of mount points. It encodes the logic that the longer a mount point the more specific it is. This allows to "shadow" a shorter mount point by a longer one.

func (*Store) Mounts

func (r *Store) Mounts() map[string]string

Mounts returns a map of mounts with their paths

func (*Store) Move

func (r *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) NoConfirm

func (s *Store) NoConfirm() bool

NoConfirm returns true if no recipients should be confirmed on encryption

func (*Store) NoPager added in v1.3.0

func (s *Store) NoPager() bool

NoPager retuns true if the user doesn't want a pager for longer output

func (*Store) Path

func (s *Store) Path() string

Path returns the store path

func (*Store) Prune

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

Prune will remove a subtree from the Store

func (*Store) RecipientsTree

func (r *Store) RecipientsTree(pretty bool) (tree.Tree, error)

RecipientsTree returns a tree view of all stores' recipients

func (*Store) RemoveMount

func (r *Store) RemoveMount(alias string) error

RemoveMount removes and existing mount

func (*Store) RemoveRecipient

func (r *Store) RemoveRecipient(store, rec string) error

RemoveRecipient removes a single recipient from the given store

func (*Store) RemoveTemplate

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

RemoveTemplate will delete the named template if it exists

func (*Store) SafeContent

func (s *Store) SafeContent() bool

SafeContent returns the value of safe content

func (*Store) SaveRecipients added in v1.3.0

func (r *Store) SaveRecipients() error

SaveRecipients persists the recipients to disk. Only useful if persist keys is enabled

func (*Store) Set

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

Set encodes and write the ciphertext of one entry to disk

func (*Store) SetConfirm

func (r *Store) SetConfirm(name string, content []byte, reason string, cb store.RecipientCallback) error

SetConfirm calls Set with confirmation callback

func (*Store) SetKey

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

SetKey sets a single key in structured document (YAML) to the given value. If the secret name is non-empty but no YAML it will return an error.

func (*Store) SetPassword added in v1.3.0

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

SetPassword Update only the first line in an already existing entry

func (*Store) SetTemplate

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

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

func (*Store) String

func (r *Store) String() string

func (*Store) TemplateTree

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

TemplateTree returns a tree of all templates

func (*Store) Tree

func (r *Store) Tree() (tree.Tree, error)

Tree returns the tree representation of the entries

func (*Store) UpdateConfig

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

UpdateConfig updates this root-stores internal config and propagates those changes to all substores

Jump to

Keyboard shortcuts

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