credentials

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: GPL-3.0, LGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Credential struct {
	Name     string
	Username string
	// contains filtered or unexported fields
}

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)
	// contains filtered or unexported fields
}

Resolver reads the credentials of a site.

func (*Resolver) Get

func (r *Resolver) Get(ctx context.Context, name string) (Credential, error)

Get resolves a credential by name, reading its password once per process.

Jump to

Keyboard shortcuts

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