Documentation
¶
Overview ¶
Package auth reads the daemon credential profile written by oac-core-device: server URL, runtime row id (= device_id), and the long-lived runner_credential. Stored as JSON per-profile at ~/.oac/daemon/<profile>/auth.json (0o600).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotPaired = errors.New("auth: no daemon credential profile — create one with oac-core-device")
ErrNotPaired is returned by Load when no auth.json exists for the requested profile.
Functions ¶
This section is empty.
Types ¶
type Profile ¶
type Profile struct {
// ServerURL is the absolute base URL the daemon dials (no
// trailing slash). The daemon joins this with paths like
// /agent-daemon/bootstrap.
ServerURL string `json:"server_url"`
// RuntimeID is the runtimes row id. The gateway uses it verbatim
// as device_id on WS upgrade.
RuntimeID string `json:"runtime_id"`
// RunnerCredential is the bearer presented on every
// /agent-daemon/* call. Stored plaintext in a 0o600 file; the
// server holds only the hash, so this is the only proof of
// identity and MUST NOT be checked into VCS.
RunnerCredential string `json:"runner_credential"`
DeviceName string `json:"device_name,omitempty"`
}
Profile is the on-disk representation of one daemon credential.