aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_client/auth.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 14:20:49 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 14:20:49 +0200
commit199563550dd41c3dfb703bd3747604a8a03cdbc5 (patch)
tree30cfa3e5539f782b7571091c742ee1c219e138fb /crates/turtle/src/atuin_client/auth.rs
parentchore: Restore db migrations (diff)
downloadatuin-199563550dd41c3dfb703bd3747604a8a03cdbc5.zip
chore: Remove all `pub`s
They will not be marked by rustc/cargo as unused, and as atuin doesn't expose an API all of them _should_ be `pub(crate)`
Diffstat (limited to 'crates/turtle/src/atuin_client/auth.rs')
-rw-r--r--crates/turtle/src/atuin_client/auth.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/turtle/src/atuin_client/auth.rs b/crates/turtle/src/atuin_client/auth.rs
index b770c488..b260d433 100644
--- a/crates/turtle/src/atuin_client/auth.rs
+++ b/crates/turtle/src/atuin_client/auth.rs
@@ -15,7 +15,7 @@ use crate::atuin_client::settings::Settings;
static APP_USER_AGENT: &str = concat!("atuin/", env!("CARGO_PKG_VERSION"));
/// Result of an auth operation that may require 2FA.
-pub enum AuthResponse {
+pub(crate) enum AuthResponse {
/// Operation succeeded; for login/register, contains the session token.
/// `auth_type` indicates the kind of token: `Some("hub")` for Hub API
/// tokens (prefixed `atapi_`), `Some("cli")` for legacy CLI session
@@ -30,7 +30,7 @@ pub enum AuthResponse {
}
/// Result of a mutating account operation that may require 2FA.
-pub enum MutateResponse {
+pub(crate) enum MutateResponse {
/// Operation completed successfully.
Success,
/// Two-factor authentication is required; the caller should prompt for a
@@ -43,7 +43,7 @@ pub enum MutateResponse {
/// CLI commands use this trait so they don't need to know which backend is
/// active — they just prompt for input and call these methods.
#[async_trait]
-pub trait AuthClient: Send + Sync {
+pub(crate) trait AuthClient: Send + Sync {
/// Log in with username + password, optionally providing a TOTP code.
async fn login(&self, username: &str, password: &str) -> Result<AuthResponse>;
@@ -67,7 +67,7 @@ pub trait AuthClient: Send + Sync {
}
/// Resolve the appropriate [`AuthClient`] for the current settings.
-pub async fn auth_client(settings: &Settings) -> Box<dyn AuthClient> {
+pub(crate) async fn auth_client(settings: &Settings) -> Box<dyn AuthClient> {
Box::new(LegacyAuthClient::new(
&settings.sync_address,
settings.session_token().await.ok(),
@@ -80,7 +80,7 @@ pub async fn auth_client(settings: &Settings) -> Box<dyn AuthClient> {
// Legacy backend — talks to the Rust sync server
// ---------------------------------------------------------------------------
-pub struct LegacyAuthClient {
+pub(crate) struct LegacyAuthClient {
address: String,
session_token: Option<String>,
connect_timeout: u64,
@@ -88,7 +88,7 @@ pub struct LegacyAuthClient {
}
impl LegacyAuthClient {
- pub fn new(
+ pub(crate) fn new(
address: &str,
session_token: Option<String>,
connect_timeout: u64,