Expand description
Silicon Accounts sign-in for Commit’s own tools.
Commit’s CLI (or any tool of Commit’s that runs on someone’s machine) is a public
client at Silicon Accounts: it holds no app secret, only Commit’s app id. A Carbon
signs in with the device flow (approve a code on the account site); a Silicon hands
over a short-lived token (slt_…) it minted with silicon-accounts login --app commit -q.
Both return Commit’s tokens: an access token (30 minutes, aud = commit) and a refresh
token that rotates on every use. Presenting a used refresh token ends the whole sign-in,
so refresh one at a time and store the new pair before using it.
This module is stateless like the rest of the crate: callers decide where tokens live.
Structs§
- Account
Link - A reference to another account: its permanent uuid and current id.
- Accounts
Auth - Signs Carbons and Silicons in to Commit at Silicon Accounts, without an app secret.
- Accounts
Auth Builder - Builder for
AccountsAuth. - Claims
- The claims of a Silicon Accounts access token.
- Device
Authorization POST /v1/device/authorize: showuser_codeandverification_urito the Carbon, then poll with the device code.- Revocation
- The answer of a revocation.
- SignIn
- A finished sign-in: Commit’s tokens and the account they belong to.
- Signed
InAccount - The account a sign-in belongs to, as Silicon Accounts shows it to Commit.
Enums§
- Account
Kind - Whether an account belongs to a Carbon or a Silicon.
- Device
Event - What
AccountsAuth::wait_for_device_sign_inreports between polls. - Device
Status - One poll of a device sign-in.
- Sign
InRefusal - Why Silicon Accounts refused a short-lived token or refresh token (
invalid_grant), from its description.Nonewhen the error is not such a refusal.
Constants§
- APP_ID
- Commit’s app id at Silicon Accounts.
- DEFAULT_
ACCOUNTS_ URL - The production Silicon Accounts URL.
Functions§
- peek_
claims - Reads an access token’s claims WITHOUT verifying it: for display only (which account,
which app, until when). Never authorize anything with the result; Commit verifies every
token itself.
Nonewhen the value is not a JWT.