Documentation
¶
Overview ¶
Package credentials resolves the credentials of an action from their sources, the strategies of a CNAB credential set (cnab-spec 802-credential-sets.md), as Porter writes them:
credentials:
- name: token
source: { path: /tmp/token } # env, path, command or value
Only the source of a credential is ever kept: its value is read when the action runs, handed to the runtime, and never written anywhere.
Index ¶
- func Absolute(strategy valuesource.Strategy, directory string) valuesource.Strategy
- func Merge(bundle cnab.ExtendedBundle, base, given []valuesource.Strategy) []valuesource.Strategy
- func Parse(name, text string) (valuesource.Strategy, error)
- func Resolve(strategies []valuesource.Strategy, bundle cnab.ExtendedBundle, action string) (valuesource.Set, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Absolute ¶
func Absolute(strategy valuesource.Strategy, directory string) valuesource.Strategy
Absolute returns the strategy with its path made absolute from directory, so that it reads the same file from anywhere. A path from a variable, $HOME/certs, is left to be expanded where it is read.
func Merge ¶
func Merge(bundle cnab.ExtendedBundle, base, given []valuesource.Strategy) []valuesource.Strategy
Merge returns the strategies of base the bundle still declares, replaced by the ones given with the same name.
func Parse ¶
func Parse(name, text string) (valuesource.Strategy, error)
Parse reads the command-line form of a credential's source, KEY:VALUE, where KEY is a source of the specification: env, path, command or value.
func Resolve ¶
func Resolve(strategies []valuesource.Strategy, bundle cnab.ExtendedBundle, action string) (valuesource.Set, error)
Resolve reads the credentials that apply to the action, from the host: its files, variables and commands. A credential the bundle does not declare is an error, as is a required one without a source.
Types ¶
This section is empty.