diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-28 15:16:43 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-06-28 15:16:43 +0100 |
| commit | a82546b70303000b4fc053a1ee21d3d8c7d6ad66 (patch) | |
| tree | f8c4238a5ae27759b3c1a6adb5c865b07e339a66 /src/repo_ref.rs | |
| parent | 6b06e874119ceca1a9dac1b94dcfe6e06aacd7b9 (diff) | |
feat(login): login with nip46 remote signer
and save details in git config
Diffstat (limited to 'src/repo_ref.rs')
| -rw-r--r-- | src/repo_ref.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/repo_ref.rs b/src/repo_ref.rs index 2b0d024..426640f 100644 --- a/src/repo_ref.rs +++ b/src/repo_ref.rs | |||
| @@ -11,7 +11,7 @@ use crate::client::Client; | |||
| 11 | use crate::client::MockConnect; | 11 | use crate::client::MockConnect; |
| 12 | use crate::{ | 12 | use crate::{ |
| 13 | cli_interactor::{Interactor, InteractorPrompt, PromptInputParms}, | 13 | cli_interactor::{Interactor, InteractorPrompt, PromptInputParms}, |
| 14 | client::Connect, | 14 | client::{sign_event, Connect}, |
| 15 | git::{Repo, RepoActions}, | 15 | git::{Repo, RepoActions}, |
| 16 | }; | 16 | }; |
| 17 | 17 | ||
| @@ -95,8 +95,8 @@ pub static REPO_REF_KIND: u16 = 30_617; | |||
| 95 | 95 | ||
| 96 | impl RepoRef { | 96 | impl RepoRef { |
| 97 | pub async fn to_event(&self, signer: &NostrSigner) -> Result<nostr::Event> { | 97 | pub async fn to_event(&self, signer: &NostrSigner) -> Result<nostr::Event> { |
| 98 | signer | 98 | sign_event( |
| 99 | .sign_event_builder(nostr_sdk::EventBuilder::new( | 99 | nostr_sdk::EventBuilder::new( |
| 100 | nostr::event::Kind::Custom(REPO_REF_KIND), | 100 | nostr::event::Kind::Custom(REPO_REF_KIND), |
| 101 | "", | 101 | "", |
| 102 | [ | 102 | [ |
| @@ -152,9 +152,11 @@ impl RepoRef { | |||
| 152 | // code languages and hashtags | 152 | // code languages and hashtags |
| 153 | ] | 153 | ] |
| 154 | .concat(), | 154 | .concat(), |
| 155 | )) | 155 | ), |
| 156 | .await | 156 | signer, |
| 157 | .context("failed to create repository reference event") | 157 | ) |
| 158 | .await | ||
| 159 | .context("failed to create repository reference event") | ||
| 158 | } | 160 | } |
| 159 | } | 161 | } |
| 160 | 162 | ||