secrets

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 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 is the one place celestial-data knows its secrets: each service it signs in to, the fields that service's secret has, and where in 1Password the person who runs it keeps that secret. The config says where; op reads it, each time it is needed.

A secret goes only to the code that asked for it. What op prints, the secret, is never put in an error, and nothing this package writes holds it.

Two things are passed on as they come, and are trusted to hold no secret: op's own words when it fails, and an error from the Reader a Keeper is given. That boundary is theirs to keep, and is the whole of what this package promises.

Index

Constants

View Source
const Tool = "celestial-data-secrets"

Tool is the name of the command that keeps the secrets, and of its folder in the person's config.

Variables

This section is empty.

Functions

func Beside

func Beside(home, name string) string

Beside is a file of a name in the config's folder under a home, where what a login keeps is kept unless the person says otherwise.

func Path

func Path(home string) string

Path is where the config is kept under a home: the tool's own folder of the home's .config, as pzm keeps every tool's.

func Unplaced

func Unplaced() error

Unplaced is the refusal of a service the config gives no place, for errors.Is.

Types

type Keeper

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

Keeper reads the secrets of the services the config places, through a reader.

func Open

func Open(path string, keys Reader) (*Keeper, error)

Open is a keeper of the services the config at path places, reading through keys. A config that is not there places nothing; one that will not read is refused, naming its line.

func (Keeper) Item

func (keeper Keeper) Item(name string) (string, error)

Item is the op:// item the config places a service's secret in.

func (Keeper) Secret

func (keeper Keeper) Secret(name string) (map[string]string, error)

Secret is a service's secret, each field by name, read through op.

type OnePassword

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

OnePassword reads secrets with the 1Password command, op. Each read may ask the person at the keyboard to allow it.

func NewOnePassword

func NewOnePassword(command string) OnePassword

NewOnePassword is a reader that runs command as op.

func (OnePassword) Read

func (keys OnePassword) Read(reference string) (string, error)

Read runs op read for reference and gives what it printed, without the end of the line. A failure names the reference and passes on op's own words from its errors, never what it printed. That those words hold no secret is op's to keep.

type Reader

type Reader interface {
	Read(reference string) (string, error)
}

Reader reads a secret by its op:// reference.

type Service

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

Service is one service celestial-data signs in to: its name, what it is, and the fields its secret has.

func Known

func Known() []Service

Known is every service celestial-data signs in to, by name.

func (Service) About

func (service Service) About() string

About says what the secret is.

func (Service) Fields

func (service Service) Fields() []string

Fields are the fields of the service's 1Password item that are read.

func (Service) Name

func (service Service) Name() string

Name is the name the config and the commands know the service by.

Jump to

Keyboard shortcuts

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