Documentation
¶
Overview ¶
Package auth manages credentials stored on disk.
Credentials are persisted as multiple KEY=VALUE entries in a single file at the path returned by config.CredentialsPath() (~/.config/jungi/credentials), with file permissions 0600 so that only the owning user can read it. No environment variables are read or written.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Registry = []Descriptor{
{
Key: "ANTHROPIC_API_KEY",
Label: "Anthropic API Key",
Description: "API key used to authenticate with the Anthropic API.",
},
{
Key: "OPENAI_API_KEY",
Label: "OpenAI API Key",
Description: "API key used to authenticate with the OpenAI API.",
},
{
Key: "JUNGI_CONTROL_API_KEY",
Label: "Jungi Control API Key",
Description: "API key used to authenticate with the jungi control service.",
},
}
Registry lists every credential /credentials can set. It is the single source of truth the picker iterates; register additional credentials here to make them selectable.
Functions ¶
func All ¶
All returns every stored credential as a map. It returns an empty map and a nil error when the file does not exist.
func AnthropicAPIKey ¶
AnthropicAPIKey returns the stored Anthropic API key, or an empty string if none has been set.
func Delete ¶
Delete removes a single key from the credentials file, preserving all other entries. It is idempotent: deleting an absent key or a missing file is not an error.
func Get ¶
Get returns the value stored for key. It returns an empty string and a nil error when the file or the key is absent; all other I/O errors are propagated.
func JungiControlAPIKey ¶
JungiControlAPIKey returns the stored jungi control API key, or an empty string if none has been set.
func OpenAIAPIKey ¶
OpenAIAPIKey returns the stored OpenAI API key, or an empty string if none has been set.
Types ¶
type Descriptor ¶
type Descriptor struct {
// Key is the KEY=VALUE store key, e.g. "ANTHROPIC_API_KEY".
Key string
// Label is the human-readable name shown in the picker.
Label string
// Description gives additional context shown alongside the label.
Description string
}
Descriptor describes a single credential the /credentials picker can offer.
Source Files
¶
- auth.go