Documentation
¶
Overview ¶
Package config loads and validates Keyway runtime configuration from a YAML file and/or environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DBURL string `yaml:"db_url"`
APIAddr string `yaml:"api_addr"`
APIToken string `yaml:"api_token"`
ProbeAllowlist []string `yaml:"probe_allowlist"`
Slack SlackConfig `yaml:"slack"`
Issuers []IssuerConfig `yaml:"issuers"`
Discovery DiscoveryConfig `yaml:"discovery"`
}
Config is the on-disk / environment configuration for the CLI and runner.
func Load ¶
Load reads a YAML config file, overlaying environment defaults for empty fields. A missing path returns the environment defaults with no error.
func LoadFile ¶
LoadFile reads a YAML config file WITHOUT overlaying environment variables. Read-modify-write commands (e.g. `issuer add`) use this so a marshal-back only ever persists what the file already contained — an ambient KEYWAY_API_TOKEN or KEYWAY_SLACK_WEBHOOK_URL is never written to disk as a side effect. A missing path returns an empty config with no error.
func Scaffold ¶
func Scaffold() Config
Scaffold returns a config suitable for writing a fresh file: sane non-secret defaults only. It deliberately does NOT read secrets (API token, Slack webhook, DB URL) from the environment, so `keyway init` never captures an ambient secret into a plaintext file — those stay in the environment.
type DiscoveryConfig ¶
type DiscoveryConfig struct {
KubeContext string `yaml:"kube_context"`
Namespaces []string `yaml:"namespaces"`
ConfigPaths []string `yaml:"config_paths"`
}
DiscoveryConfig bounds default discovery scope.
type IssuerConfig ¶
type IssuerConfig struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
URL string `yaml:"url"`
AdminCredentialEnv string `yaml:"admin_credential_env"`
}
IssuerConfig registers an issuer without embedding secrets — credentials are referenced by environment variable name only.
type SlackConfig ¶
type SlackConfig struct {
WebhookURL string `yaml:"webhook_url"`
}
SlackConfig configures the optional Slack notifier.