Documentation
¶
Overview ¶
Package enroll keeps an enrolled agent's registration credential (P1 §6): the refresh token in the supervisor's state dir, 0600, and before the first registration the one-time enrollment token from the file the config names. Tokens are never logged, and errors never carry them.
Index ¶
Constants ¶
View Source
const RefreshFile = "agent-refresh-token"
RefreshFile is the refresh token's file in the state dir.
Variables ¶
View Source
var ErrNoCredential = errors.New("no refresh token in the state dir and no enrollmentTokenFile: mint an enrollment with `factory agent enroll` and set enrollmentTokenFile to its token's file")
ErrNoCredential is Token's error when there is neither a refresh token nor an enrollment token file.
Functions ¶
This section is empty.
Types ¶
type Files ¶
type Files struct {
// StateDir holds RefreshFile (supervise's --state-dir, absolute).
StateDir string
// TokenFile is the config's enrollmentTokenFile: read only while StateDir has no refresh
// token. "" when the config sets none.
TokenFile string
}
Files is the enrollment credential on disk. It implements worker.Enrollment.
func (Files) Forget ¶
Forget removes the refresh token (the dispatcher refused it), so the next start reads TokenFile.
Click to show internal directories.
Click to hide internal directories.