Documentation
¶
Index ¶
Constants ¶
const DefaultService = "jamf-cli"
DefaultService is the keychain service name used by jamf-cli.
Variables ¶
var ErrNotFound = errors.New("keychain item not found")
ErrNotFound is returned when a keychain item does not exist.
Functions ¶
func KeychainRef ¶
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 ¶
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"
func WriteError ¶ added in v1.19.0
WriteError wraps a failed keychain write (Store.Set) with actionable, OS-specific guidance. The underlying go-keyring backends shell out to the system credential store and surface only the process exit code (e.g. macOS "exit status 154"), discarding the descriptive message — so on its own the raw error tells the user nothing about how to fix it. item is a short, human-readable label for what was being stored (e.g. "client ID").