Help us shape the future of Go! Take the 2026 Go Developer Survey

credentials

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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