Expand description
Device-flow enrollment and instance access tokens.
POST /v1/device/codeDeviceCodeRequestV1→DeviceCodeV1POST /v1/device/tokenDeviceTokenRequestV1→EnrollmentV1, or 400authorization_pending/slow_down/expired_token/access_denied, 402plan_required, 409instance_limitPOST /v1/instances/{instance_id}/tokenInstanceTokenRequestV1→AccessTokenV1POST /v1/instances/{instance_id}/lease/renew(empty body) → lease envelopeDELETE /v1/instances/{instance_id}→ 204, frees the seat
There is no refresh token: the instance’s Ed25519 key is its only long-lived secret and mints short access tokens through a signed assertion.
Re-exports§
pub use super::app_keys::AppKeyAnnouncementV1;pub use super::app_keys::AppKeyKind;pub use super::app_keys::AppKeyOfferV1;pub use super::app_keys::FEATURE_DEVICE_APP_KEYS;pub use super::app_keys::app_key_bind_signing_input;
Structs§
- Access
Token V1 - Response of
POST /v1/instances/{instance_id}/token. - Company
RefV1 - The company of a team: the business that holds its Enterprise plan.
- Device
Code Request V1 POST /v1/device/code.- Device
Code V1 - Response of
POST /v1/device/code. - Device
Setup Project V1 - Device
Setup Request V1 - C0 2.1
POST /v1/device/setup(no token; the pendingdevice_code): the project this engine runs in and what it shares, shown on the approval page (routes/device_setup.request.json). Requester’s claims. - Device
Setup Result V1 - C0 2.1
POST /v1/device/setup/result(instance token):routes/device_setup_result.request.json. - Device
Token Request V1 POST /v1/device/token: poll until the user approved, then enroll the instance with its public keys.- Enrollment
V1 - Successful
POST /v1/device/token. - Instance
Token Request V1 POST /v1/instances/{instance_id}/token.- OrgRef
V1 - Organization reference: the workspace the instance enrolls in.
Enums§
- Device
Intent DeviceCodeRequestV1.intent.- Engine
Os - Operating-system family of the engine.
- Trial
Plan DeviceCodeRequestV1.plan: the plan a one-step trial starts.
Constants§
- ACCESS_
TOKEN_ SCHEMA - DEVICE_
CODE_ REQUEST_ SCHEMA - DEVICE_
CODE_ SCHEMA - DEVICE_
SETUP_ REQUEST_ SCHEMA - DEVICE_
SETUP_ RESULT_ SCHEMA - DEVICE_
TOKEN_ REQUEST_ SCHEMA - ENROLLMENT_
SCHEMA - FEATURE_
DEVICE_ SETUP - C0 2.1
featuresentry: the approval page shares the project too. - MAX_
ACCESS_ TOKEN_ SECONDS - Longest access-token lifetime the service issues.
- MAX_
ASSERTION_ SKEW_ SECONDS - Accepted distance between
iatand service time. - MAX_
INSTANCE_ LABEL_ CHARS - Longest instance label, in characters.
- TOKEN_
REQUEST_ SCHEMA
Functions§
- token_
assertion_ input - Bytes the instance key signs:
"leanctx.cloud.token.v1\n" + instance_id + "\n" + iat + "\n" + nonce(iat in decimal unix seconds).