keychain

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultService = "jamf-cli"

DefaultService is the keychain service name used by jamf-cli.

Variables

View Source
var ErrNotFound = errors.New("keychain item not found")

ErrNotFound is returned when a keychain item does not exist.

Functions

func KeychainRef

func KeychainRef(profile, field string) string

KeychainRef builds a keychain: reference string for use in config files. Example: KeychainRef("prod", "client-secret") returns "keychain:jamf-cli/prod/client-secret"

func ParseRef

func ParseRef(value string) (service, account string)

ParseRef parses a keychain reference value into service and account. The input is the portion after the "keychain:" prefix.

Format: "service/account/subkey" or just "account/subkey" If the value contains exactly two slashes, the first segment is the service. Otherwise DefaultService is used and the entire value is the account.

Examples:

"jamf-cli/prod/client-secret" -> service="jamf-cli", account="prod/client-secret"
"prod/client-secret"             -> service="jamf-cli", account="prod/client-secret"

Types

type Store

type Store interface {
	Get(service, account string) (string, error)
	Set(service, account, secret string) error
	Delete(service, account string) error
}

Store provides access to the system keychain.

func New

func New() Store

New returns a Store backed by the system keychain.

Jump to

Keyboard shortcuts

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