Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KeychainStore keychain.Store
KeychainStore allows overriding the keychain implementation for testing. When nil, the real system keychain is used.
Functions ¶
func ConfigPath ¶
func ConfigPath() string
ConfigPath returns the path to the config file using XDG conventions.
func GetKeychainStore ¶
GetKeychainStore returns the configured keychain store, falling back to the real system keychain when no override has been set via KeychainStore.
func ResolveSecret ¶
ResolveSecret resolves a secret value that must use a recognized prefix:
- "env:VAR_NAME" — reads the value from environment variable VAR_NAME
- "file:/path" — reads the value from the file at /path
- "keychain:ref" — reads the value from the system keychain
Empty strings are returned as-is. Any other value is rejected.
Types ¶
type Config ¶
type Config struct {
DefaultProfile string `yaml:"default-profile"`
DefaultOutput string `yaml:"default-output,omitempty"`
Profiles map[string]Profile `yaml:"profiles"`
}
Config represents the CLI configuration
type Profile ¶
type Profile struct {
Product string `yaml:"product,omitempty"` // "pro" (default), "protect", "school", or "security"
URL string `yaml:"url"`
AuthMethod string `yaml:"auth-method"` // token, oauth2, platform, apikey, security
Token string `yaml:"token,omitempty"`
ClientID string `yaml:"client-id,omitempty"`
ClientSecret string `yaml:"client-secret,omitempty"`
TenantID string `yaml:"tenant-id,omitempty"` // platform auth
PlatformURL string `yaml:"platform-url,omitempty"` // school: separate gateway URL for Platform API
NetworkID string `yaml:"network-id,omitempty"` // school only
APIKey string `yaml:"api-key,omitempty"` // school only
// Security (Jamf Security Cloud) only: each of the Risk, Device Lifecycle,
// and Shared Signals & Events APIs is provisioned as its own "Security
// Integration" with its own application ID/secret, so — unlike every other
// product's single ClientID/ClientSecret pair — Security needs up to
// three independent pairs. Any subset may be configured; commands for an
// unconfigured API fail with a "run security setup" hint.
SSEURL string `yaml:"sse-url,omitempty"` // separate host for Shared Signals & Events
RiskClientID string `yaml:"risk-client-id,omitempty"`
RiskClientSecret string `yaml:"risk-client-secret,omitempty"`
LifecycleClientID string `yaml:"lifecycle-client-id,omitempty"`
LifecycleClientSecret string `yaml:"lifecycle-client-secret,omitempty"`
SSEClientID string `yaml:"sse-client-id,omitempty"`
SSEClientSecret string `yaml:"sse-client-secret,omitempty"`
DestructiveCooldown *time.Duration `yaml:"destructive-cooldown,omitempty"`
}
Profile represents a server profile for a Jamf product.
Click to show internal directories.
Click to hide internal directories.