open-vault/command/token/helper.go
Jeff Mitchell 1a324cf347 Make TokenHelper an interface and split exisiting functionality
Functionality is split into ExternalTokenHelper, which is used if a path
is given in a configuration file, and InternalTokenHelper which is used
otherwise. The internal helper no longer shells out to the same Vault
binary, instead performing the same actions with internal code. This
avoids problems using dev mode when there are spaces in paths or when
the binary is built in a container without a shell.

Fixes #850 among others
2015-12-22 10:23:30 -05:00

15 lines
427 B
Go

package token
// TokenHelper is an interface that contains basic operations that must be
// implemented by a token helper
type TokenHelper interface {
// Path displays a backend-specific path; for the internal helper this
// is the location of the token stored on disk; for the external helper
// this is the location of the binary being invoked
Path() string
Erase() error
Get() (string, error)
Store(string) error
}