Expand description
Enrollment (device flow), access tokens and lease renewal.
The instance’s Ed25519 key is its only long-lived secret: every access token is minted from a fresh signed assertion and cached until shortly before it expires. Nothing here runs inside a tool call.
Structs§
- Enrollment
Token - A pre-issued Host enrollment token (
het_and 64 hex digits) that a team admin handed out, e.g. through MDM. It enrolls this machine without a browser approval. The value is wiped on drop and never printed: itsDebugshows the prefix only, and no error names it. - Session
- A connected instance: its record, verified lease and keys.
- Setup
Announcement - The project an engine names at connect (C0 2.1 device setup): the checkout’s folder name and the remote it sees, plus what it shares.
Constants§
- ENROLLMENT_
TOKEN_ PREFIX - The plaintext prefix of a pre-issued Host enrollment token.
- ENROLLMENT_
TOKEN_ UNUSABLE - Why a Cloud refused an enrollment token, in the words a person acts on.
Functions§
- announce_
setup - Step 1b (C0 2.1): name the project and what this machine shares, so the
approval page asks “Share this project” too. Only when the Cloud offers
it;
falsewhen it did not take it (the terminal then asks, as before). - complete_
enrollment - Verify an enrollment answer against the root key and persist it.
- engine_
os - enroll_
with_ token - Enroll this machine with a pre-issued enrollment token (no browser):
one
POST /v1/device/tokenwith the token asdevice_code, then the enrollment is verified and persisted exactly as after a device approval. - finish_
device_ flow - Step 2: poll until the user approved (or the code expired), then verify
and persist the enrollment.
sleepis injectable for tests. - start_
device_ flow - Step 1: ask Cloud for a device code;
labelis the user’s--label, if any (the approval page shows it, Cloud task #11). - start_
device_ flow_ for - Step 1 for
cloud connect [--trial]:trialnames the plan whose one-step trial the browser starts (None: a plain sign-in, whose request is exactly the one older Clouds know). - trial_
refusal - A trial request an older Cloud refused for its unknown members (
400 invalid_request) isCloudError::TrialUnsupported: it is never sent again without them, so nobody signs in thinking a trial started.
Type Aliases§
- Sharing
Answer - What the device approval answered beyond the enrollment: the page’s
answer to “Share this project” (C0 2.1).
None: the page did not ask (no setup, or an older Cloud);Some(None): an older page approved it.