Skip to main content

Module kasl_server

Module kasl_server 

Source
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§

AgentIdentity
The identity behind a token, as GET /api/v1/agent/whoami reports it.
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 /health reports.
KaslServer
A client bound to one kasl-server instance.
PauseUpload
One break, as the server takes it.
TaskUpload
One task, keyed by the ids this agent knows it by.

Enums§

UploadError
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.