auth

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 5 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 auth handles credential storage and retrieval for Mush.

Credentials are sourced in the following priority order:

  1. Environment variable: MUSHER_API_KEY
  2. OS Keyring (macOS Keychain, Windows Credential Manager, Linux Secret Service)
  3. Config file fallback: ~/.config/mush/credentials (for non-interactive environments)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAPIKey

func DeleteAPIKey() error

DeleteAPIKey removes the stored API key.

func StoreAPIKey

func StoreAPIKey(apiKey string) error

StoreAPIKey stores the API key in the OS keyring. Falls back to file storage if keyring is unavailable.

Types

type CredentialSource

type CredentialSource string

CredentialSource indicates where credentials were found.

const (
	SourceEnv     CredentialSource = "environment variable"
	SourceKeyring CredentialSource = "keyring"
	SourceFile    CredentialSource = "config file"
	SourceNone    CredentialSource = ""
)

Credential source constants identify where credentials were loaded from.

func GetCredentials

func GetCredentials() (source CredentialSource, apiKey string)

GetCredentials returns the API key and its source. Returns empty strings if no credentials are found.

Jump to

Keyboard shortcuts

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