From 9eb2ffb2e9b52cdec70acb268e7a12131811db10 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 10 Jun 2026 23:12:17 +0200 Subject: chore: Somewhat simplify sync code --- crates/atuin-client/src/api_client.rs | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'crates/atuin-client/src/api_client.rs') diff --git a/crates/atuin-client/src/api_client.rs b/crates/atuin-client/src/api_client.rs index 066fecb5..ca2fc661 100644 --- a/crates/atuin-client/src/api_client.rs +++ b/crates/atuin-client/src/api_client.rs @@ -40,8 +40,6 @@ static APP_USER_AGENT: &str = concat!("atuin/", env!("CARGO_PKG_VERSION"),); /// authentication across CLI and Hub features. #[derive(Debug, Clone)] pub enum AuthToken { - /// Hub API token, used with "Bearer {token}" header - Bearer(String), /// Legacy CLI session token, used with "Token {token}" header Token(String), } @@ -50,7 +48,6 @@ impl AuthToken { /// Format the token as an Authorization header value fn to_header_value(&self) -> String { match self { - AuthToken::Bearer(token) => format!("Bearer {token}"), AuthToken::Token(token) => format!("Token {token}"), } } @@ -139,27 +136,6 @@ pub async fn login(address: &str, req: LoginRequest) -> Result { Ok(session) } -#[cfg(feature = "check-update")] -pub async fn latest_version() -> Result { - use atuin_common::api::IndexResponse; - - ensure_crypto_provider(); - let url = "https://api.atuin.sh"; - let client = reqwest::Client::new(); - - let resp = client - .get(url) - .header(USER_AGENT, APP_USER_AGENT) - .send() - .await?; - let resp = handle_resp_error(resp).await?; - - let index = resp.json::().await?; - let version = Version::parse(index.version.as_str())?; - - Ok(version) -} - pub fn ensure_version(response: &Response) -> Result { let version = response.headers().get(ATUIN_HEADER_VERSION); -- cgit v1.3.1