provider

package
v0.10.10 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 15 Imported by: 0

README

github.com/cyberark/summon/provider

Functions to resolve and call a Summon provider.

func Resolve(providerArg string) (string, error)

Searches for a provider in this order:

  1. providerArg, passed in via CLI
  2. environment variable SUMMON_PROVIDER
  3. check for directory /usr/local/lib/summon (or %ProgramW6432%\Cyberark Conjur\Summon\Providers on Windows): if it exist, search providers there
  4. if all of the above do not exist: use <path_to_summon_excutable>\Providers for searching providers (aka 'portable mode')

Attention: the provider search is limited to the first directory found according to the priority list above. That means, if the system directory exist the local directory will never be searched, even if the system directory is empty.

In order to migrate from system directory configuration to a local provider directory you need to move all providers to the local provider dir AND delete the system directory.

func Call(provider, specPath string) (string, error)

Given a provider and secret's namespace, runs the provider to resolve the secret's value.

func CallInteractiveMode(provider string, secrets secretsyml.SecretsMap) (chan Result, chan error, func())

Given a provider and secrets, runs the provider in interactive mode to resolve multiple secret's values in a single process.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInteractiveModeNotSupported = errors.New("interactive mode not supported")

ErrInteractiveModeNotSupported is returned when a provider does not support interactive mode

Functions

func Call

func Call(provider, specPath string) (string, error)

Call shells out to a provider and return its output If call succeeds, stdout is returned with no error If call fails, "" is return with error containing stderr

func CallInteractiveMode

func CallInteractiveMode(provider string, secrets secretsyml.SecretsMap) (chan Result, chan error, func())

CallInteractiveMode calls a provider without passing any arguments. It then constantly fetches secrets from its stdout. It returns a channel of results, a channel of errors and a cleanup function.

func GetAllProviders

func GetAllProviders(providerDir string) ([]string, error)

GetAllProviders creates slice of all file names in the default path

func GetDefaultPath

func GetDefaultPath() (string, error)

func Resolve

func Resolve(providerArg string) (string, error)

Resolve resolves a filepath to a provider Checks the CLI arg, environment and then default path

Types

type Result

type Result struct {
	Key   string
	Value string
	Error error
}

Result represents secret key and its value taken from the provider

Jump to

Keyboard shortcuts

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