auth

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

func Load

func Load(profile string) (Profile, error)

Load reads the profile's auth.json. Returns ErrNotPaired wrapping fs.ErrNotExist when the file is missing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL