secrets

package
v0.7.160 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOpNotFound = errors.New("op CLI not found")

ErrOpNotFound reports that the 1Password CLI is not on PATH. Callers use it to tell "you need to install op" apart from "op ran and could not read the ref", which need different advice.

Functions

func IsSecretRef

func IsSecretRef(value string) bool

IsSecretRef reports whether value is a secret reference (op:// prefix).

func ResolveAll

func ResolveAll(ctx context.Context, vars map[string]string, resolver Resolver) (map[string]string, error)

ResolveAll resolves op:// references in a map. Non-reference values pass through unchanged. If resolver is nil, uses OpResolver. Returns the original map if no references are found.

Types

type OpResolver

type OpResolver struct {
	// contains filtered or unexported fields
}

OpResolver resolves references via `op read <ref>`.

func (*OpResolver) Resolve

func (r *OpResolver) Resolve(ctx context.Context, ref string) (string, error)

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, ref string) (string, error)
}

Resolver resolves secret reference URIs to plaintext values.

Jump to

Keyboard shortcuts

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