keyring

package
v3.28.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package keyring provides secure credential storage using the OS keychain. It falls back to file-based storage when the keychain is unavailable (e.g., in CI environments).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockForTesting

func MockForTesting()

MockForTesting replaces the keyring backend with an in-memory store and resets the availability cache so subsequent New() calls reflect the mock.

Types

type Keyring

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

Keyring provides secure credential storage with fallback support

func New

func New() *Keyring

New creates a new Keyring instance. It automatically detects if the system keyring is available.

func (*Keyring) Delete

func (k *Keyring) Delete(org string) error

Delete removes a token for the given organization

func (*Keyring) Get

func (k *Keyring) Get(org string) (string, error)

Get retrieves a token for the given organization

func (*Keyring) IsAvailable

func (k *Keyring) IsAvailable() bool

IsAvailable returns true if the system keyring is available

func (*Keyring) Set

func (k *Keyring) Set(org, token string) error

Set stores a token for the given organization

Jump to

Keyboard shortcuts

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