secrets

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTokenKey added in v0.7.1

func IsTokenKey(key string) bool

IsTokenKey reports whether a keyring key is an olk token entry.

func TokenKey

func TokenKey(email string) string

TokenKey returns the canonical keyring key for a given email address. Format: olk:token:<email>

Types

type KeyringStore

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

KeyringStore implements Store using the keyring library for cross-platform credential storage (macOS Keychain, Linux Secret Service, Windows WinCred).

func NewKeyringStore

func NewKeyringStore() (*KeyringStore, error)

NewKeyringStore creates a new KeyringStore backed by the OS credential manager.

func (*KeyringStore) Delete

func (s *KeyringStore) Delete(key string) error

Delete removes the entry for the given key.

func (*KeyringStore) Get

func (s *KeyringStore) Get(key string) (string, error)

Get retrieves the value stored under the given key.

func (*KeyringStore) Keys

func (s *KeyringStore) Keys() ([]string, error)

Keys returns all keys currently stored in the keyring.

func (*KeyringStore) Set

func (s *KeyringStore) Set(key, value string) error

Set stores a value under the given key.

type Store

type Store interface {
	Set(key, value string) error
	Get(key string) (string, error)
	Delete(key string) error
	Keys() ([]string, error)
}

Store defines the interface for credential storage.

Jump to

Keyboard shortcuts

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