aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client/src/meta.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2026-02-12 11:58:54 -0800
committerGitHub <noreply@github.com>2026-02-12 11:58:54 -0800
commit94b2fd238ef3ce2b1b65a8a12c3ad72ef88dab40 (patch)
treece7b8eed476cf1ab414c2f1f8235b53b8f7ecd02 /crates/atuin-client/src/meta.rs
parentfeat(docs): Add Shell Integration and Interoperability docs (#3163) (diff)
downloadatuin-94b2fd238ef3ce2b1b65a8a12c3ad72ef88dab40.zip
feat: add Hub authentication for future sync + extra features (#3010)
Diffstat (limited to 'crates/atuin-client/src/meta.rs')
-rw-r--r--crates/atuin-client/src/meta.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/atuin-client/src/meta.rs b/crates/atuin-client/src/meta.rs
index 870f36d0..94ddcaf3 100644
--- a/crates/atuin-client/src/meta.rs
+++ b/crates/atuin-client/src/meta.rs
@@ -21,6 +21,7 @@ const KEY_LAST_SYNC: &str = "last_sync_time";
const KEY_LAST_VERSION_CHECK: &str = "last_version_check_time";
const KEY_LATEST_VERSION: &str = "latest_version";
const KEY_SESSION: &str = "session";
+const KEY_HUB_SESSION: &str = "hub_session";
const KEY_FILES_MIGRATED: &str = "files_migrated";
pub struct MetaStore {
@@ -189,6 +190,24 @@ impl MetaStore {
Ok(self.session_token().await?.is_some())
}
+ // Hub session methods (separate from sync session, used for Hub-specific features like AI)
+
+ pub async fn hub_session_token(&self) -> Result<Option<String>> {
+ self.get(KEY_HUB_SESSION).await
+ }
+
+ pub async fn save_hub_session(&self, token: &str) -> Result<()> {
+ self.set(KEY_HUB_SESSION, token).await
+ }
+
+ pub async fn delete_hub_session(&self) -> Result<()> {
+ self.delete(KEY_HUB_SESSION).await
+ }
+
+ pub async fn hub_logged_in(&self) -> Result<bool> {
+ Ok(self.hub_session_token().await?.is_some())
+ }
+
// File migration: on first open, migrate old plain-text files into the database.
// Old files are left in place for safe downgrades.