diff --git a/Cargo.lock b/Cargo.lock index 72a40e3..14d7ac3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1233,9 +1233,7 @@ dependencies = [ [[package]] name = "http-relay" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e21bdfe99224d6d446eb1b6ecc139ed96a7a8f0a77a123158b9c31d1dbbbcb08" +version = "0.2.0" dependencies = [ "anyhow", "axum", @@ -1250,6 +1248,8 @@ dependencies = [ [[package]] name = "http-relay" version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0043bce2a7f4a4fbc870c4489223052b3aba084ead8a39581ea69d3e9a3e04a9" dependencies = [ "anyhow", "axum", @@ -2112,7 +2112,7 @@ dependencies = [ "js-sys", "log", "pkarr", - "pubky-common 0.2.0", + "pubky-common 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "pubky-testnet", "reqwest", "thiserror 2.0.11", @@ -2127,9 +2127,7 @@ dependencies = [ [[package]] name = "pubky-common" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3fc5af2af85da2967ce17a91aae82c828b750db748e24eadb5e06c0ade2ad2" +version = "0.3.0" dependencies = [ "argon2", "base32", @@ -2149,6 +2147,8 @@ dependencies = [ [[package]] name = "pubky-common" version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77dddc23db4c39c39412fdede996c16e36c93aedfe61226913f389df118a9254" dependencies = [ "argon2", "base32", @@ -2185,7 +2185,7 @@ dependencies = [ "page_size", "pkarr", "postcard", - "pubky-common 0.2.0", + "pubky-common 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "tokio", "toml", @@ -2202,11 +2202,11 @@ name = "pubky-testnet" version = "0.1.0" dependencies = [ "anyhow", - "http-relay 0.1.0", + "http-relay 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "mainline", "pkarr-relay", "pubky", - "pubky-common 0.2.0", + "pubky-common 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "pubky-homeserver", "tokio", "tracing-subscriber", diff --git a/pubky-homeserver/Cargo.toml b/pubky-homeserver/Cargo.toml index 2fc3094..d776b50 100644 --- a/pubky-homeserver/Cargo.toml +++ b/pubky-homeserver/Cargo.toml @@ -18,7 +18,7 @@ hex = "0.4.3" httpdate = "1.0.3" postcard = { version = "1.1.1", features = ["alloc"] } pkarr = { version = "3.1.1", features = ["dht", "lmdb-cache", "tls"] } -pubky-common = "0.2.0" +pubky-common = "0.3.0" serde = { version = "1.0.217", features = ["derive"] } tokio = { version = "1.43.0", features = ["full"] } toml = "0.8.20" diff --git a/pubky-testnet/Cargo.toml b/pubky-testnet/Cargo.toml index 129d766..4d325ab 100644 --- a/pubky-testnet/Cargo.toml +++ b/pubky-testnet/Cargo.toml @@ -12,11 +12,11 @@ categories = ["web-programming", "authentication", "cryptography"] [dependencies] anyhow = "1.0.95" -http-relay = "0.1.0" +http-relay = "0.2.0" mainline = "5.2.0" pkarr-relay = "0.3.0" pubky = { version = "0.3.0", path = "../pubky" } -pubky-common = "0.2.0" +pubky-common = "0.3.0" pubky-homeserver = { version = "0.1.0", path = "../pubky-homeserver" } tokio = { version = "1.43.0", features = ["full"] } tracing-subscriber = "0.3.19" diff --git a/pubky/Cargo.toml b/pubky/Cargo.toml index cafeacd..efad20a 100644 --- a/pubky/Cargo.toml +++ b/pubky/Cargo.toml @@ -25,7 +25,7 @@ cookie_store = { version = "0.21.1", default-features = false } anyhow = "1.0.95" flume = { version = "0.11.1", default-features = false, features = ["async"] } futures-util = "0.3.31" -pubky-common = "0.2.0" +pubky-common = "0.3.0" # Native dependencies [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/pubky/src/native/api/auth.rs b/pubky/src/native/api/auth.rs index 9c7e183..4031d7c 100644 --- a/pubky/src/native/api/auth.rs +++ b/pubky/src/native/api/auth.rs @@ -134,7 +134,7 @@ impl Client { let token = AuthToken::sign(keypair, capabilities); - let encrypted_token = encrypt(&token.serialize(), &client_secret)?; + let encrypted_token = encrypt(&token.serialize(), &client_secret); let engine = base64::engine::GeneralPurpose::new(&URL_SAFE, NO_PAD); diff --git a/pubky/src/wasm/api/recovery_file.rs b/pubky/src/wasm/api/recovery_file.rs index 8a968f4..65cc417 100644 --- a/pubky/src/wasm/api/recovery_file.rs +++ b/pubky/src/wasm/api/recovery_file.rs @@ -6,10 +6,10 @@ use crate::wasm::wrappers::keys::Keypair; /// Create a recovery file of the `keypair`, containing the secret key encrypted /// using the `passphrase`. #[wasm_bindgen(js_name = "createRecoveryFile")] -pub fn create_recovery_file(keypair: &Keypair, passphrase: &str) -> Result { +pub fn create_recovery_file(keypair: &Keypair, passphrase: &str) -> Uint8Array { pubky_common::recovery_file::create_recovery_file(keypair.as_inner(), passphrase) - .map(|b| b.as_slice().into()) - .map_err(|e| JsValue::from_str(&e.to_string())) + .as_slice() + .into() } /// Create a recovery file of the `keypair`, containing the secret key encrypted