keyring

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package keyring keeps the JEV API key in the operating system's credential store: the macOS Keychain, the Windows Credential Manager, or the freedesktop Secret Service on Linux and the BSDs (GNOME Keyring, KWallet, KeePassXC). It needs nothing beyond the standard library and golang.org/x/sys: on macOS and Linux it runs the system's own command line tools (security, secret-tool), handing them the secret on stdin so it never appears in a process list; on Windows it calls the Credential Manager API directly. See docs/contributing/architecture.md.

Index

Constants

View Source
const (
	Service = "012"
	Account = "jev-api-key"
	Label   = "012 JEV API key"
)

Service and Account name the stored item.

Variables

View Source
var ErrNotFound = errors.New("no key in the credential store")

ErrNotFound means no key is stored.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	Err error // returned by every call when set
	// contains filtered or unexported fields
}

Memory is a Store in memory, for tests.

func (*Memory) Delete

func (m *Memory) Delete(context.Context) error

func (*Memory) Get

func (m *Memory) Get(context.Context) (string, error)

func (*Memory) Name

func (m *Memory) Name() string

func (*Memory) Set

func (m *Memory) Set(_ context.Context, s string) error

type Store

type Store interface {
	Get(ctx context.Context) (string, error)
	Set(ctx context.Context, secret string) error
	Delete(ctx context.Context) error
	// Name is what the store is called, e.g. "macOS Keychain".
	Name() string
}

Store keeps one secret.

func System

func System() Store

System is the Secret Service, through secret-tool.

Jump to

Keyboard shortcuts

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