Skip to main content

Crate silicon_commit_client

Crate silicon_commit_client 

Source
Expand description

Stateless client for Silicon Commit, the work manager for Carbons and Silicons.

Two parts:

  • Client: the Commit HTTP API (/api/v1): todos, notes, notification rules, projects, diaries, tasks, versions, email settings, bug reports, the Silicon allow-list. Authenticate with a Silicon Accounts access token issued to Commit (Client::with_bearer), or, from another app acting for an account, with a User verification proof (Client::with_proof).
  • auth::AccountsAuth: sign-in for Commit’s own tools at Silicon Accounts, with no app secret: the device flow for Carbons, short-lived token exchange for Silicons, refresh and revocation.

Nothing is stored: callers own tokens and decide where they live. Keep a Mutation across retries of one logical write.

use silicon_commit_client::{Client, Mutation};
let commit = Client::new("https://api.commit.teamofsilicons.com")?.with_bearer(access_token);
let mine = commit.list_todos(&[("view", "assigned_to_me")]).await?;
let create = commit.with_mutation(Mutation::new());
create
    .create_todo(&serde_json::json!({"title": "Review the release", "assigned_to": "si:builder"}))
    .await?;

Modules§

auth
Silicon Accounts sign-in for Commit’s own tools.

Structs§

ApiError
The Commit API’s error envelope plus transport metadata.
Client
The Commit API client. Holds configuration and a connection pool, never sessions.
Mutation
A logical mutation: reuse the same value after an uncertain response so the API applies the write once (Idempotency-Key), optionally with If-Match.

Enums§

Error
Everything that can go wrong in this crate.

Constants§

CONTRACT_VERSION
The API contract this client speaks (X-Commit-API-Version).
DEFAULT_API_URL
The production Commit API origin.

Traits§

ExposeSecret
Token wrappers used by auth::SignIn (tokens are redacted from Debug output). Expose a reference to an inner secret

Functions§

is_loopback
True for localhost, *.localhost, 127.0.0.0/8 and ::1.

Type Aliases§

SecretString
Token wrappers used by auth::SignIn (tokens are redacted from Debug output). Secret string type.