action

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 65 Imported by: 0

Documentation

Overview

Package action implements all the handlers that are available as subcommands for gopass.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKey

func GetKey(ctx context.Context) string

GetKey returns the value of key or the default (empty string).

func GetPrintChars

func GetPrintChars(ctx context.Context) []int

GetPrintChars returns a map of all character positions to print.

func GetRevision

func GetRevision(ctx context.Context) string

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

func HasKey

func HasKey(ctx context.Context) bool

HasKey returns true if the key is set.

func HasRevision

func HasRevision(ctx context.Context) bool

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

func IsAlsoClip

func IsAlsoClip(ctx context.Context) bool

IsAlsoClip returns the value for alsoclip of the dfeault (false).

func IsClip

func IsClip(ctx context.Context) bool

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

func IsOnlyClip

func IsOnlyClip(ctx context.Context) bool

IsOnlyClip returns the value of clip 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 ShowFlags

func ShowFlags() []cli.Flag

ShowFlags returns the flags for the show command. Exported to re-use in main for the default command.

func WithAlsoClip

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

WithAlsoClip returns a context with the value for alsoclip (copy to clipboard and print to stdout) set.

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 WithKey

func WithKey(ctx context.Context, sv string) context.Context

WithKey returns a context with the key set.

func WithOnlyClip

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

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

func WithPasswordOnly

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

WithPasswordOnly returns a context with the value of password only set.

func WithPrintChars

func WithPrintChars(ctx context.Context, c []int) context.Context

WithPrintChars returns the context with the print chars 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(cfg *config.Config, sv semver.Version) (*Action, error)

New returns a new Action wrapper.

func (*Action) AliasesAdd

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

AliasesAdd adds a single alias to a domain.

func (*Action) AliasesDelete

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

AliasesDelete remove an alias mapping for a domain.

func (*Action) AliasesPrint

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

AliasesPrint prints all cofigured aliases.

func (*Action) AliasesRemove

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

AliasesRemove removes a single alias from a domain.

func (*Action) Audit

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

Audit validates passwords against common flaws.

func (*Action) BinaryCopy

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

BinaryCopy copies either from the filesystem to the store or from the store. to the filesystem.

func (*Action) BinaryMove

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

BinaryMove works like Copy but will remove (shred/wipe) the source after a successful copy. Mostly useful for securely moving secrets into the store if they are no longer needed / wanted on disk afterwards.

func (*Action) Cat

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

Cat prints to or reads from STDIN/STDOUT.

func (*Action) Clone

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

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

func (*Action) Complete

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

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

func (*Action) CompleteGenerate

func (s *Action) CompleteGenerate(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(a *cli.App) error

CompletionFish returns an autocompletion script for fish.

func (*Action) CompletionOpenBSDKsh

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

CompletionOpenBSDKsh returns an OpenBSD ksh script used for auto completion.

func (*Action) CompletionZSH

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

CompletionZSH returns a zsh completion script.

func (*Action) Config

func (s *Action) Config(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) Convert

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

Convert converts a store to a different set of backends.

func (*Action) Copy

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

Copy the contents of a file to another one.

func (*Action) Create

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

Create displays the password creation wizard.

func (*Action) Delete

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

Delete a secret file with its content.

func (*Action) Edit

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

Edit the content of a password file.

func (*Action) Env

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

Env implements the env subcommand. It populates the environment of a subprocess with a set of environment variables corresponding to the secret subtree specified on the command line.

func (*Action) Find

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

Find runs find.

func (*Action) FindNoFuzzy

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

FindNoFuzzy runs find without fuzzy search.

func (*Action) Fsck

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

Fsck checks the store integrity.

func (*Action) Generate

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

Generate and save a password.

func (*Action) GetCommands

func (s *Action) GetCommands() []*cli.Command

GetCommands returns the cli commands exported by this module.

func (*Action) Git

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

Git passes the git command to the underlying backend.

func (*Action) Grep

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

Grep searches a string inside the content of all files.

func (*Action) History

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

History displays the history of a given secret.

func (*Action) Init

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

Init a new password store with a first gpg id.

func (*Action) Insert

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

Insert a string as content to a secret file.

func (*Action) IsInitialized

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

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

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

Link creates a symlink.

func (*Action) List

func (s *Action) List(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) Merge

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

Merge implements the merge subcommand that allows merging multiple entries.

func (*Action) MountAdd

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

MountAdd adds a new mount.

func (*Action) MountRemove

func (s *Action) MountRemove(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(c *cli.Context) error

MountsPrint prints all existing mounts.

func (*Action) Move

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

Move the content from one secret to another.

func (*Action) OTP

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

OTP implements OTP token handling for TOTP and HOTP.

func (*Action) Process

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

Process is a command to process a template and replace secrets contained in it.

func (*Action) RCSAddRemote

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

RCSAddRemote adds a new git remote.

func (*Action) RCSInit

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

RCSInit initializes a git repo including basic configuration.

func (*Action) RCSPull

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

RCSPull pulls from a git remote.

func (*Action) RCSPush

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

RCSPush pushes to a git remote.

func (*Action) RCSRemoveRemote

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

RCSRemoveRemote removes a git remote.

func (*Action) RCSStatus

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

RCSStatus prints the rcs status.

func (*Action) REPL

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

REPL implements a read-execute-print-line shell with readline support and autocompletion.

func (*Action) RecipientsAdd

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

RecipientsAdd adds new recipients.

func (*Action) RecipientsComplete

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

RecipientsComplete will print a list of recipients for bash completion.

func (*Action) RecipientsPrint

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

RecipientsPrint prints all recipients per store.

func (*Action) RecipientsRemove

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

RecipientsRemove removes recipients.

func (*Action) Setup

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

Setup will invoke the onboarding / setup wizard.

func (*Action) Show

func (s *Action) Show(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) Sum

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

Sum decodes binary content and computes the SHA256 checksum.

func (*Action) Sync

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

Sync all stores with their remotes.

func (*Action) TemplateEdit

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

TemplateEdit will load and existing or new template into an editor.

func (*Action) TemplatePrint

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

TemplatePrint will lookup and print a single template.

func (*Action) TemplateRemove

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

TemplateRemove will remove a single template.

func (*Action) TemplatesComplete

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

TemplatesComplete prints a list of all templates for bash completion.

func (*Action) TemplatesPrint

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

TemplatesPrint will pretty-print a tree of templates.

func (*Action) Unclip

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

Unclip tries to erase the content of the clipboard.

func (*Action) Update

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

Update will start the interactive update assistant.

func (*Action) Version

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

Version prints the gopass version.

Directories

Path Synopsis
Package pwgen implements the subcommands to operate the stand alone password generator.
Package pwgen implements the subcommands to operate the stand alone password generator.

Jump to

Keyboard shortcuts

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