Expand description
kasl-server client: the team server this agent reports to.
Unlike the other clients here, this one has no session to manage. The server authenticates an agent by a long-lived bearer token that an administrator issues once (ADR 0004 in kasl-server), so there is nothing to log into and nothing to cache - the token goes in the OS keyring and every request carries it.
let config = KaslServerConfig {
url: "https://kasl.example.com".to_string(),
ca_certificate: None,
};
let server = KaslServer::new(&config)?;
let health = server.health().await?;
println!("kasl-server {}", health.version);Structs§
- Agent
Identity - The identity behind a token, as
GET /api/v1/agent/whoamireports it. - Batch
Result - What came of a batch.
- Batch
Upload - A stretch of days in one request - what an agent sends after time offline.
- DayAccepted
- What the server reports about a day it stored.
- DayUpload
- One day as this agent recorded it, in the shape the server accepts.
- Health
- What
GET /healthreports. - Kasl
Server - A client bound to one kasl-server instance.
- Pause
Upload - One break, as the server takes it.
- Task
Upload - One task, keyed by the ids this agent knows it by.
Enums§
- DayResult
- One day’s fate inside a batch.
- Upload
Error - Why an upload failed, and whether sending the same bytes again could ever work.
Constants§
- AGENT_
TOKEN_ PROMPT - Prompt shown when the agent token is missing from the keyring.
- AGENT_
TOKEN_ SECRET - Keyring credential holding the agent token.
Functions§
- normalize_
url - Trims a user-typed URL into the form the client stores.