diff options
Diffstat (limited to 'crates/turtle/src/atuin_client/auth.rs')
| -rw-r--r-- | crates/turtle/src/atuin_client/auth.rs | 12 |
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, |
