action

package
v1.8.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: MIT Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExitOK means no error (status code 0)
	ExitOK = iota
	// ExitUnknown is used if we can't determine the exact exit cause
	ExitUnknown
	// ExitUsage is used if there was some kind of invocation error
	ExitUsage
	// ExitAborted is used if the user willingly aborted an action
	ExitAborted
	// ExitUnsupported is used if an operation is not supported by gopass
	ExitUnsupported
	// ExitAlreadyInitialized is used if someone is trying to initialize
	// an already initialized store
	ExitAlreadyInitialized
	// ExitNotInitialized is used if someone is trying to use an unitialized
	// store
	ExitNotInitialized
	// ExitGit is used if any git errors are encountered
	ExitGit
	// ExitMount is used if a substore mount operation fails
	ExitMount
	// ExitNoName is used when no name was provided for a named entry
	ExitNoName
	// ExitNotFound is used if a requested secret is not found
	ExitNotFound
	// ExitDecrypt is used when reading/decrypting a secret failed
	ExitDecrypt
	// ExitEncrypt is used when writing/encrypting of a secret fails
	ExitEncrypt
	// ExitList is used when listing the store content fails
	ExitList
	// ExitAudit is used when audit report possible issues
	ExitAudit
	// ExitFsck is used when the integrity check fails
	ExitFsck
	// ExitConfig is used when config errors occur
	ExitConfig
	// ExitRecipients is used when a recipient operation fails
	ExitRecipients
	// ExitIO is used for misc. I/O errors
	ExitIO
	// ExitGPG is used for misc. gpg errors
	ExitGPG
)
View Source
const (
	// BinarySuffix is the suffix that is appended to binaries in the store
	BinarySuffix = ".b64"
)

Variables

This section is empty.

Functions

func ExitError

func ExitError(ctx context.Context, exitCode int, err error, format string, args ...interface{}) error

ExitError returns a user friendly CLI error

func GetRevision

func GetRevision(ctx context.Context) string

GetRevision returns the revison set in this context or an empty string

func HasRevision

func HasRevision(ctx context.Context) bool

HasRevision returns true if a value for revision was set in this context

func IsClip

func IsClip(ctx context.Context) bool

IsClip returns the value of clip or the default (false)

func IsForce

func IsForce(ctx context.Context) bool

IsForce returns the value of force or the default (false)

func IsPasswordOnly

func IsPasswordOnly(ctx context.Context) bool

IsPasswordOnly returns the value of password only or the default (false)

func IsPrintQR

func IsPrintQR(ctx context.Context) bool

IsPrintQR returns the value of print QR or the default (false)

func WithClip

func WithClip(ctx context.Context, clip bool) context.Context

WithClip returns a context with the value for clip (for copy to clipboard) set

func WithForce

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

WithForce returns a context with the value for force set

func WithPasswordOnly

func WithPasswordOnly(ctx context.Context, pw bool) context.Context

WithPasswordOnly returns a context with the value of password only set

func WithPrintQR

func WithPrintQR(ctx context.Context, qr bool) context.Context

WithPrintQR returns a context with the value of print QR set

func WithRevision

func WithRevision(ctx context.Context, rev string) context.Context

WithRevision returns a context withe the value of revision set

Types

type Action

type Action struct {
	Name  string
	Store *root.Store
	// contains filtered or unexported fields
}

Action knows everything to run gopass CLI actions

func New

func New(ctx context.Context, cfg *config.Config, sv semver.Version) (*Action, error)

New returns a new Action wrapper

func (*Action) Audit

func (s *Action) Audit(ctx context.Context, c *cli.Context) error

Audit validates passwords against common flaws

func (*Action) Clone

func (s *Action) Clone(ctx context.Context, c *cli.Context) error

Clone will fetch and mount a new password store from a git repo

func (*Action) Complete

func (s *Action) Complete(ctx context.Context, c *cli.Context)

Complete prints a list of all password names to os.Stdout

func (*Action) CompleteGenerate added in v1.8.0

func (s *Action) CompleteGenerate(ctx context.Context, c *cli.Context)

CompleteGenerate implements the completion heuristic for the generate command

func (*Action) CompletionBash

func (s *Action) CompletionBash(c *cli.Context) error

CompletionBash returns a bash script used for auto completion

func (*Action) CompletionFish

func (s *Action) CompletionFish(c *cli.Context, a *cli.App) error

CompletionFish returns an autocompletion script for fish

func (*Action) CompletionOpenBSDKsh

func (s *Action) CompletionOpenBSDKsh(c *cli.Context, a *cli.App) error

CompletionOpenBSDKsh returns an OpenBSD ksh script used for auto completion

func (*Action) CompletionZSH

func (s *Action) CompletionZSH(c *cli.Context, a *cli.App) error

CompletionZSH returns a zsh completion script

func (*Action) Config

func (s *Action) Config(ctx context.Context, c *cli.Context) error

Config handles changes to the gopass configuration

func (*Action) ConfigComplete

func (s *Action) ConfigComplete(c *cli.Context)

ConfigComplete will print the list of valid config keys

func (*Action) ConfirmRecipients

func (s *Action) ConfirmRecipients(ctx context.Context, name string, recipients []string) ([]string, error)

ConfirmRecipients asks the user to confirm a given set of recipients

func (*Action) Copy

func (s *Action) Copy(ctx context.Context, c *cli.Context) error

Copy the contents of a file to another one

func (*Action) Delete

func (s *Action) Delete(ctx context.Context, c *cli.Context) error

Delete a secret file with its content

func (*Action) Edit

func (s *Action) Edit(ctx context.Context, c *cli.Context) error

Edit the content of a password file

func (*Action) Find

func (s *Action) Find(ctx context.Context, c *cli.Context) error

Find a string in the secret file's name

func (*Action) Fsck

func (s *Action) Fsck(ctx context.Context, c *cli.Context) error

Fsck checks the store integrity

func (*Action) Generate

func (s *Action) Generate(ctx context.Context, c *cli.Context) error

Generate and save a password

func (*Action) GitAddRemote

func (s *Action) GitAddRemote(ctx context.Context, c *cli.Context) error

GitAddRemote adds a new git remote

func (*Action) GitCredentialBefore added in v1.8.0

func (s *Action) GitCredentialBefore(ctx context.Context, c *cli.Context) error

GitCredentialBefore is executed before another git-credential command

func (*Action) GitCredentialErase added in v1.8.0

func (s *Action) GitCredentialErase(ctx context.Context, c *cli.Context) error

GitCredentialErase removes a credential got from git

func (*Action) GitCredentialGet added in v1.8.0

func (s *Action) GitCredentialGet(ctx context.Context, c *cli.Context) error

GitCredentialGet returns a credential to git

func (*Action) GitCredentialStore added in v1.8.0

func (s *Action) GitCredentialStore(ctx context.Context, c *cli.Context) error

GitCredentialStore stores a credential got from git

func (*Action) GitInit

func (s *Action) GitInit(ctx context.Context, c *cli.Context) error

GitInit initializes a git repo including basic configuration

func (*Action) GitPull

func (s *Action) GitPull(ctx context.Context, c *cli.Context) error

GitPull pulls from a git remote

func (*Action) GitPush

func (s *Action) GitPush(ctx context.Context, c *cli.Context) error

GitPush pushes to a git remote

func (*Action) GitRemoveRemote

func (s *Action) GitRemoveRemote(ctx context.Context, c *cli.Context) error

GitRemoveRemote removes a git remote

func (*Action) Grep

func (s *Action) Grep(ctx context.Context, c *cli.Context) error

Grep searches a string inside the content of all files

func (*Action) HIBP

func (s *Action) HIBP(ctx context.Context, c *cli.Context) error

HIBP compares all entries from the store against the provided SHA1 sum dumps

func (*Action) History

func (s *Action) History(ctx context.Context, c *cli.Context) error

History displays the history of a given secret

func (*Action) Init

func (s *Action) Init(ctx context.Context, c *cli.Context) error

Init a new password store with a first gpg id

func (*Action) InitOnboarding

func (s *Action) InitOnboarding(ctx context.Context, c *cli.Context) error

InitOnboarding will invoke the onboarding / setup wizard

func (*Action) Initialized

func (s *Action) Initialized(ctx context.Context, c *cli.Context) error

Initialized returns an error if the store is not properly prepared.

func (*Action) Insert

func (s *Action) Insert(ctx context.Context, c *cli.Context) error

Insert a string as content to a secret file

func (*Action) JSONAPI

func (s *Action) JSONAPI(ctx context.Context, c *cli.Context) error

JSONAPI reads a json message on stdin and responds on stdout

func (*Action) List

func (s *Action) List(ctx context.Context, c *cli.Context) error

List all secrets as a tree. If the filter argument is non-empty display only those that have this prefix

func (*Action) MountAdd

func (s *Action) MountAdd(ctx context.Context, c *cli.Context) error

MountAdd adds a new mount

func (*Action) MountRemove

func (s *Action) MountRemove(ctx context.Context, c *cli.Context) error

MountRemove removes an existing mount

func (*Action) MountsComplete

func (s *Action) MountsComplete(*cli.Context)

MountsComplete will print a list of existings mount points for bash completion

func (*Action) MountsPrint

func (s *Action) MountsPrint(ctx context.Context, c *cli.Context) error

MountsPrint prints all existing mounts

func (*Action) Move

func (s *Action) Move(ctx context.Context, c *cli.Context) error

Move the content from one secret to another

func (*Action) OTP

func (s *Action) OTP(ctx context.Context, c *cli.Context) error

OTP implements OTP token handling for TOTP and HOTP

func (*Action) RecipientsAdd

func (s *Action) RecipientsAdd(ctx context.Context, c *cli.Context) error

RecipientsAdd adds new recipients

func (*Action) RecipientsComplete

func (s *Action) RecipientsComplete(ctx context.Context, c *cli.Context)

RecipientsComplete will print a list of recipients for bash completion

func (*Action) RecipientsPrint

func (s *Action) RecipientsPrint(ctx context.Context, c *cli.Context) error

RecipientsPrint prints all recipients per store

func (*Action) RecipientsRemove

func (s *Action) RecipientsRemove(ctx context.Context, c *cli.Context) error

RecipientsRemove removes recipients

func (*Action) RecipientsUpdate added in v1.8.0

func (s *Action) RecipientsUpdate(ctx context.Context, c *cli.Context) error

RecipientsUpdate will recompute and update any changed recipients list checksums

func (*Action) SetupNativeMessaging

func (s *Action) SetupNativeMessaging(ctx context.Context, c *cli.Context) error

SetupNativeMessaging sets up manifest for gopass as native messaging host

func (*Action) Show

func (s *Action) Show(ctx context.Context, c *cli.Context) error

Show the content of a secret file

func (*Action) String

func (s *Action) String() string

String implement fmt.Stringer

func (*Action) Sync

func (s *Action) Sync(ctx context.Context, c *cli.Context) error

Sync all stores with their remotes

func (*Action) TemplateEdit

func (s *Action) TemplateEdit(ctx context.Context, c *cli.Context) error

TemplateEdit will load and existing or new template into an editor

func (*Action) TemplatePrint

func (s *Action) TemplatePrint(ctx context.Context, c *cli.Context) error

TemplatePrint will lookup and print a single template

func (*Action) TemplateRemove

func (s *Action) TemplateRemove(ctx context.Context, c *cli.Context) error

TemplateRemove will remove a single template

func (*Action) TemplatesComplete

func (s *Action) TemplatesComplete(ctx context.Context, c *cli.Context)

TemplatesComplete prints a list of all templates for bash completion

func (*Action) TemplatesPrint

func (s *Action) TemplatesPrint(ctx context.Context, c *cli.Context) error

TemplatesPrint will pretty-print a tree of templates

func (*Action) Unclip

func (s *Action) Unclip(ctx context.Context, c *cli.Context) error

Unclip tries to erase the content of the clipboard

func (*Action) Update

func (s *Action) Update(ctx context.Context, c *cli.Context) error

Update will start the interactive update assistant

func (*Action) Version

func (s *Action) Version(ctx context.Context, c *cli.Context) error

Version prints the gopass version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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