upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/lib/login
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/login')
-rw-r--r--src/lib/login/mod.rs7
-rw-r--r--src/lib/login/user.rs8
2 files changed, 5 insertions, 10 deletions
diff --git a/src/lib/login/mod.rs b/src/lib/login/mod.rs
index 19bb97c..7364edf 100644
--- a/src/lib/login/mod.rs
+++ b/src/lib/login/mod.rs
@@ -19,11 +19,14 @@ use crate::{
19 Interactor, InteractorPrompt, PromptConfirmParms, PromptInputParms, PromptPasswordParms, 19 Interactor, InteractorPrompt, PromptConfirmParms, PromptInputParms, PromptPasswordParms,
20 }, 20 },
21 client::{fetch_public_key, get_event_from_global_cache, Connect}, 21 client::{fetch_public_key, get_event_from_global_cache, Connect},
22 config::{UserMetadata, UserRef, UserRelayRef, UserRelays},
23 git::{Repo, RepoActions}, 22 git::{Repo, RepoActions},
24 key_handling::encryption::{decrypt_key, encrypt_key},
25}; 23};
26 24
25mod key_encryption;
26use key_encryption::{decrypt_key, encrypt_key};
27mod user;
28use user::{UserMetadata, UserRef, UserRelayRef, UserRelays};
29
27/// handles the encrpytion and storage of key material 30/// handles the encrpytion and storage of key material
28#[allow(clippy::too_many_arguments)] 31#[allow(clippy::too_many_arguments)]
29pub async fn launch( 32pub async fn launch(
diff --git a/src/lib/login/user.rs b/src/lib/login/user.rs
index 547fe7e..46652db 100644
--- a/src/lib/login/user.rs
+++ b/src/lib/login/user.rs
@@ -1,15 +1,7 @@
1use anyhow::{anyhow, Result};
2use directories::ProjectDirs;
3use nostr::PublicKey; 1use nostr::PublicKey;
4use nostr_sdk::Timestamp; 2use nostr_sdk::Timestamp;
5use serde::{self, Deserialize, Serialize}; 3use serde::{self, Deserialize, Serialize};
6 4
7pub fn get_dirs() -> Result<ProjectDirs> {
8 ProjectDirs::from("", "", "ngit").ok_or(anyhow!(
9 "should find operating system home directories with rust-directories crate"
10 ))
11}
12
13#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] 5#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
14pub struct UserRef { 6pub struct UserRef {
15 pub public_key: PublicKey, 7 pub public_key: PublicKey,