keyring

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 8 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 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