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.
Health
What GET /health reports.
KaslServer
A client bound to one kasl-server instance.

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.