diff options
Diffstat (limited to 'crates/atuin-client/src/api_client.rs')
| -rw-r--r-- | crates/atuin-client/src/api_client.rs | 24 |
1 files changed, 0 insertions, 24 deletions
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<LoginResponse> { Ok(session) } -#[cfg(feature = "check-update")] -pub async fn latest_version() -> Result<Version> { - 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::<IndexResponse>().await?; - let version = Version::parse(index.version.as_str())?; - - Ok(version) -} - pub fn ensure_version(response: &Response) -> Result<bool> { let version = response.headers().get(ATUIN_HEADER_VERSION); |
