Skip to main content

Module creds

Module creds 

Source
Expand description

Locate the Command Code OAuth credential a local harness already holds.

Command Code is reachable through several agent harnesses, and each files the same OAuth credential under its own key in its own file. This module reads them; it never writes. Refreshing an expired token belongs to the CLI that owns the file, and racing it here would corrupt state shared by every harness on the machine.

Structs§

Credential
A credential and where it came from.

Constants§

AUTH_FILES
Files searched in order; the first holding a live credential wins.
EXPIRED
SIGNED_OUT

Functions§

default_paths
Default search paths, resolved against the OS home convention.
read_from
Read whichever credential shape a harness wrote into path.
resolve
Production resolver: the env override, then configured paths, then the platform defaults. Tests use resolve_from, which takes both as inputs.
resolve_from
Resolve one credential from the environment, then each path in turn.