opstore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 12 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 opstore keeps SSH keys as items in 1Password, through the op CLI.

The private key is generated inside 1Password and never written to disk: sshmgr only ever reads an item's public key back. Items are found by title (the key name) and then addressed by ID, so an edit or an archive cannot land on a different item that happens to share a title.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found in 1Password")

ErrNotFound means no item in the vault has the title.

Functions

func AgentConfigPath

func AgentConfigPath() string

AgentConfigPath is where the 1Password SSH agent reads agent.toml: $XDG_CONFIG_HOME/1Password/ssh/agent.toml when XDG_CONFIG_HOME is set, else ~/.config/1Password/ssh/agent.toml (on Windows, %LOCALAPPDATA%/1Password/config/ssh/agent.toml).

func AgentServesVault

func AgentServesVault(vault, configPath string) (bool, string)

AgentServesVault reports whether the 1Password SSH agent offers every key in vault, and if not, what to change. Every key in the vault matters, not just today's: a rotation's .staged item has to be served to be verified.

With no agent.toml the agent serves only the default vaults. Once the file exists it serves only what the file lists - even an empty file overrides the default - so the vault then needs its own whole-vault entry.

Types

type Client

type Client struct {
	Bin     string
	Timeout time.Duration
}

Client runs the op CLI. Bin is "op" unless a test points it elsewhere.

func New

func New() *Client

New returns a client for the op on PATH.

func (*Client) Archive

func (c *Client) Archive(vault, id string) error

Archive moves the item with id to 1Password's Archive, where it can still be restored. sshmgr never deletes an item outright.

func (*Client) Available

func (c *Client) Available() error

Available reports why op cannot be used, or nil.

func (*Client) Create

func (c *Client) Create(vault, title string) (Item, error)

Create generates a new Ed25519 SSH key item titled title in vault and returns it. The private key stays in 1Password.

func (*Client) Get

func (c *Client) Get(vault, title string) (Item, error)

Get returns the item titled title in vault, or ErrNotFound.

func (*Client) Rename

func (c *Client) Rename(vault, id, title string) error

Rename retitles the item with id.

type Item

type Item struct {
	ID          string
	Title       string
	Vault       string
	PublicKey   string // OpenSSH one-line form
	Fingerprint string // as 1Password reports it; may be empty
}

Item is the part of a 1Password SSH Key item sshmgr uses.

Jump to

Keyboard shortcuts

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