Documentation
¶
Index ¶
Constants ¶
const DefaultBaseURL = "https://api.bron.org"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
ActiveProfile string `yaml:"active_profile"`
Profiles map[string]Profile `yaml:"profiles"`
// contains filtered or unexported fields
}
func (*Config) Resolve ¶
Resolve returns the profile to use, applying env overrides on top of YAML. Precedence (highest first): explicit name → BRON_PROFILE → ActiveProfile → "default". Env vars BRON_WORKSPACE_ID, BRON_BASE_URL, BRON_API_KEY, BRON_API_KEY_FILE, BRON_PROXY override individual fields. BRON_API_KEY (raw JWK bytes) wins over BRON_API_KEY_FILE / key_file when both are set — it's the path used by secret-store wrappers like `op run -- bron …` that inject the key as env.
type Profile ¶
type Profile struct {
Workspace string `yaml:"workspace,omitempty"`
BaseURL string `yaml:"base_url,omitempty"`
KeyFile string `yaml:"key_file,omitempty"`
Proxy string `yaml:"proxy,omitempty"`
// APIKey is set transiently from $BRON_API_KEY in Resolve(). Never read
// from or written to YAML — keeps the JWK out of on-disk config so secret
// stores (1Password, Vault, sops) can pipe it via env without leaving a
// file on disk. Takes precedence over KeyFile when both are present.
APIKey string `yaml:"-"`
}
func (*Profile) LoadKey ¶ added in v0.3.7
LoadKey returns the raw JWK bytes for the profile. Source precedence:
- APIKey (set from $BRON_API_KEY) — used as-is, no disk access.
- KeyFile — read from disk after the standard 0600 permission check.
Trailing whitespace is preserved; callers TrimSpace before handing the value to the SDK so a stray newline from `op read > file` doesn't corrupt the JWK parse.