Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvVars ¶
func EnvVars(schema map[string]sdk.FieldName) sdk.Provisioner
EnvVars creates an EnvVarProvisioner that provisions secrets as environment variables, based on the specified schema of field name and environment variable name.
func NoOp ¶
func NoOp() sdk.Provisioner
NoOp can be used as a provisioner stub while developing plugins.
func TempFile ¶
func TempFile(fileContents ItemToFileContents, opts ...FileOption) sdk.Provisioner
TempFile returns a file provisioner and takes a function that maps a 1Password item to the contents of a single file.
Types ¶
type EnvVarProvisioner ¶
type EnvVarProvisioner struct { sdk.Provisioner Schema map[string]sdk.FieldName }
EnvVarProvisioner provisions secrets as environment variables.
func (EnvVarProvisioner) Deprovision ¶
func (p EnvVarProvisioner) Deprovision(ctx context.Context, in sdk.DeprovisionInput, out *sdk.DeprovisionOutput)
func (EnvVarProvisioner) Description ¶
func (p EnvVarProvisioner) Description() string
func (EnvVarProvisioner) Provision ¶
func (p EnvVarProvisioner) Provision(ctx context.Context, in sdk.ProvisionInput, out *sdk.ProvisionOutput)
type FileOption ¶
type FileOption func(*FileProvisioner)
FileOption can be used to influence the behavior of the file provisioner.
func AddArgs ¶
func AddArgs(argTemplates ...string) FileOption
AddArgs can be used to add args to the command line. This is useful when the output file path should be passed as an arg. The output path is available as "{{ .Path }}" in each arg. For example: * `AddArgs("--config-file", "{{ .Path }}")` will result in `--config-file /path/to/tempfile`. * `AddArgs("--config-file={{ .Path }}")` will result in `--config-file=/path/to/tempfile`.
func AtFixedPath ¶
func AtFixedPath(path string) FileOption
AtFixedPath can be used to tell the file provisioner to store the credential at a specific location, instead of an autogenerated temp dir. This is useful for executables that can only load credentials from a specific path.
func Filename ¶
func Filename(name string) FileOption
Filename can be used to tell the file provisioner to store the credential with a specific name, instead of an autogenerated name. The specified filename will be appended to the path of the autogenerated temp dir. Gets ignored if the provision.AtFixedPath option is also set.
func SetOutputDirAsEnvVar ¶
func SetOutputDirAsEnvVar(envVarName string) FileOption
SetOutputDirAsEnvVar can be used to provision the directory of the output file as an environment variable.
func SetPathAsEnvVar ¶
func SetPathAsEnvVar(envVarName string) FileOption
SetPathAsEnvVar can be used to provision the temporary file path as an environment variable.
type FileProvisioner ¶
type FileProvisioner struct { sdk.Provisioner // contains filtered or unexported fields }
FileProvisioner provisions one or more secrets as a temporary file.
func (FileProvisioner) Deprovision ¶
func (p FileProvisioner) Deprovision(ctx context.Context, in sdk.DeprovisionInput, out *sdk.DeprovisionOutput)
func (FileProvisioner) Description ¶
func (p FileProvisioner) Description() string
func (FileProvisioner) Provision ¶
func (p FileProvisioner) Provision(ctx context.Context, in sdk.ProvisionInput, out *sdk.ProvisionOutput)
type ItemToFileContents ¶
type ItemToFileContents func(in sdk.ProvisionInput) ([]byte, error)
func FieldAsFile ¶
func FieldAsFile(fieldName sdk.FieldName) ItemToFileContents
FieldAsFile can be used to store the value of a single field as a file.