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. A value source is recorded without its value: the action that needs it is given it again.
Index ¶
- Constants
- func Absolute(strategy valuesource.Strategy, directory string) valuesource.Strategy
- func IsUnrecorded(source valuesource.Source) bool
- func Merge(bundle cnab.ExtendedBundle, base, given []valuesource.Strategy) []valuesource.Strategy
- func Pack(definition, extended cnab.ExtendedBundle, values valuesource.Set) (valuesource.Set, error)
- func Parse(name, text string) (valuesource.Strategy, error)
- func Recorded(strategies []valuesource.Strategy) []valuesource.Strategy
- func RecordedSource(source *valuesource.Source) *valuesource.Source
- func Resolve(strategies []valuesource.Strategy, bundle cnab.ExtendedBundle, action string) (valuesource.Set, error)
- func WithOverride(definition cnab.ExtendedBundle, override string) (cnab.ExtendedBundle, error)
Constants ¶
const Redacted = "*******"
Redacted stands for a secret nemo does not record: the value of a value source, of a sensitive parameter or of a write-only output.
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 IsUnrecorded ¶ added in v0.6.0
func IsUnrecorded(source valuesource.Source) bool
IsUnrecorded reports whether the source is a value source as nemo records it, without its value.
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 Pack ¶ added in v0.11.0
func Pack(definition, extended cnab.ExtendedBundle, values valuesource.Set) (valuesource.Set, error)
Pack moves the values of the credentials the bundle does not declare, those WithOverride adds, into the credential the installer reads them from, as JSON by variable.
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 Recorded ¶ added in v0.6.0
func Recorded(strategies []valuesource.Strategy) []valuesource.Strategy
Recorded returns the strategies as nemo records them, their value sources without their value.
func RecordedSource ¶ added in v0.6.0
func RecordedSource(source *valuesource.Source) *valuesource.Source
RecordedSource returns the source as nemo records it.
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.
func WithOverride ¶ added in v0.11.0
func WithOverride(definition cnab.ExtendedBundle, override string) (cnab.ExtendedBundle, error)
WithOverride returns the bundle as an installation's override extends it: each variable the override reads a secret or a config from, that is neither a parameter nor a credential of the bundle, is declared as a credential, required by install and upgrade, named after it, TLS_KEY as tls-key. The stack's credentials of those names are then merged, resolved and checked as the bundle's own, and Pack hands them to the installer.
Types ¶
This section is empty.