Documentation
¶
Overview ¶
Package credentials resolves the accounts used for service processors and power distribution units.
A password is never written in the configuration, only where to read it from: an environment variable, a file, an age encrypted file, a key of a sops encrypted Secret document, a helper command or the terminal. Once resolved it is passed to a backend over a file or standard input, never in an argument vector where ps would show it to everyone on the host.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
Credential is a resolved account.
func (Credential) Password ¶
func (c Credential) Password() string
Password returns the secret. It is deliberately a method rather than a field, so that a credential printed with %v or serialised into output does not carry the password with it.
func (Credential) String ¶
func (c Credential) String() string
String hides the password from logs and error messages.
type Resolver ¶
type Resolver struct {
// Credentials are the configured entries.
Credentials map[string]v1alpha1.Credential
// BaseDir is what relative file paths resolve against.
BaseDir string
// Identities are the age identities used for an ageFile source.
Identities []string
// Env reads environment variables; nil reads the process environment.
Env func(string) string
// Prompt asks the administrator for a password.
Prompt func(prompt string) (string, error)
// Secret reads a key of a Secret document for a secretRef source.
Secret func(ref v1alpha1.SecretKeyRef) ([]byte, error)
// NoTerminal says that nobody is at a terminal to answer a prompt, as
// under the MCP server. A command source then runs in a session of its
// own, so that a helper such as gpg's pinentry cannot ask on whatever
// terminal the process was started from.
NoTerminal bool
// contains filtered or unexported fields
}
Resolver reads the credentials of a site.