diff --git a/iroh/src/client/docs.rs b/iroh/src/client/docs.rs index b175283386a..26955687a82 100644 --- a/iroh/src/client/docs.rs +++ b/iroh/src/client/docs.rs @@ -16,8 +16,8 @@ use iroh_blobs::{export::ExportProgress, store::ExportMode, Hash}; use iroh_docs::{ actor::OpenState, store::{DownloadPolicy, Query}, - AuthorId, Capability, CapabilityKind, ContentStatus, DocTicket, NamespaceId, PeerIdBytes, - RecordIdentifier, + AuthorId, Capability, CapabilityKind, ContentStatus, DocTicket, NamespaceId, NamespaceSecret, + PeerIdBytes, RecordIdentifier, }; use iroh_net::NodeAddr; use portable_atomic::{AtomicBool, Ordering}; @@ -65,9 +65,9 @@ impl Client { } /// Export secret key - pub async fn export_secret_key(&self, doc_id: NamespaceId) -> Result<()> { - self.rpc.rpc(ExportSecretKeyRequest { doc_id }).await??; - Ok(()) + pub async fn export_secret_key(&self, doc_id: NamespaceId) -> Result { + let response = self.rpc.rpc(ExportSecretKeyRequest { doc_id }).await??; + Ok(response.secret) } /// Import a document from a namespace capability. diff --git a/iroh/src/rpc_protocol/docs.rs b/iroh/src/rpc_protocol/docs.rs index 1197bcd7ca0..197d891e126 100644 --- a/iroh/src/rpc_protocol/docs.rs +++ b/iroh/src/rpc_protocol/docs.rs @@ -75,7 +75,7 @@ pub enum Response { SetDownloadPolicy(RpcResult), GetSyncPeers(RpcResult), StreamCreated(RpcResult), - ExportSecretKey(RpcResult) + ExportSecretKey(RpcResult), } /// Subscribe to events for a document.