secrets

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: GPL-3.0 Imports: 11 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 secrets resolves durable opaque references without placing values in configuration, process arguments, or environment variables.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidReference = errors.New("invalid keychain reference")
	ErrItemNotFound     = errors.New("macOS Keychain item not found")
)

Functions

This section is empty.

Types

type Keychain

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

func NewKeychain

func NewKeychain(run commandRunner) *Keychain

func (*Keychain) Resolve

func (k *Keychain) Resolve(ctx context.Context, reference string) (string, error)

Resolve reads one macOS generic-password item. The reference format is keychain://<service>/<account>; the returned value never appears in errors.

func (*Keychain) Store

func (k *Keychain) Store(ctx context.Context, reference, value string) error

Store creates one macOS generic-password item without exposing value in process arguments or environment variables. It refuses to replace an item.

type Reference

type Reference struct {
	Service string
	Account string
}

Reference is a validated macOS Keychain generic-password identity.

func ParseReference

func ParseReference(reference string) (Reference, error)

ParseReference validates a keychain://service/account reference without retaining or echoing the original input in errors.

Jump to

Keyboard shortcuts

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