From 6b80b74cb1c73d3889da3d6e01aed626c87732e4 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Tue, 23 Sep 2025 09:27:07 +0100 Subject: [PATCH] feat: remove features from auth (#1103) --- .github/workflows/ci.yml | 3 --- crates/cdk-ffi/Cargo.toml | 7 +------ crates/cdk-ffi/src/types.rs | 6 ------ crates/cdk-ffi/src/wallet.rs | 3 +-- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 219a9e30..649af8b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,9 +120,6 @@ jobs: # FFI bindings -p cdk-ffi, - -p cdk-ffi --no-default-features, - -p cdk-ffi --no-default-features --features auth, - -p cdk-ffi --no-default-features --features bip353, # Binaries --bin cdk-cli, diff --git a/crates/cdk-ffi/Cargo.toml b/crates/cdk-ffi/Cargo.toml index 0840750b..b8cef967 100644 --- a/crates/cdk-ffi/Cargo.toml +++ b/crates/cdk-ffi/Cargo.toml @@ -10,15 +10,10 @@ rust-version.workspace = true crate-type = ["cdylib", "staticlib", "rlib"] name = "cdk_ffi" -[features] -default = ["auth", "bip353"] -auth = ["cdk/auth"] -bip353 = ["cdk/bip353"] - [dependencies] async-trait = { workspace = true } bip39 = { workspace = true } -cdk = { workspace = true, default-features = false, features = ["wallet"] } +cdk = { workspace = true, default-features = false, features = ["wallet", "auth", "bip353"] } cdk-sqlite = { workspace = true } ctor = "0.2" futures = { workspace = true } diff --git a/crates/cdk-ffi/src/types.rs b/crates/cdk-ffi/src/types.rs index e5da421c..60194aa6 100644 --- a/crates/cdk-ffi/src/types.rs +++ b/crates/cdk-ffi/src/types.rs @@ -1998,7 +1998,6 @@ impl TryFrom for cdk::wallet::types::TransactionId { } /// FFI-compatible AuthProof -#[cfg(feature = "auth")] #[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)] pub struct AuthProof { /// Keyset ID @@ -2011,7 +2010,6 @@ pub struct AuthProof { pub y: String, } -#[cfg(feature = "auth")] impl From for AuthProof { fn from(auth_proof: cdk::nuts::AuthProof) -> Self { Self { @@ -2026,7 +2024,6 @@ impl From for AuthProof { } } -#[cfg(feature = "auth")] impl TryFrom for cdk::nuts::AuthProof { type Error = FfiError; @@ -2047,7 +2044,6 @@ impl TryFrom for cdk::nuts::AuthProof { } } -#[cfg(feature = "auth")] impl AuthProof { /// Convert AuthProof to JSON string pub fn to_json(&self) -> Result { @@ -2056,14 +2052,12 @@ impl AuthProof { } /// Decode AuthProof from JSON string -#[cfg(feature = "auth")] #[uniffi::export] pub fn decode_auth_proof(json: String) -> Result { Ok(serde_json::from_str(&json)?) } /// Encode AuthProof to JSON string -#[cfg(feature = "auth")] #[uniffi::export] pub fn encode_auth_proof(proof: AuthProof) -> Result { Ok(serde_json::to_string(&proof)?) diff --git a/crates/cdk-ffi/src/wallet.rs b/crates/cdk-ffi/src/wallet.rs index 4772f64d..04d2035f 100644 --- a/crates/cdk-ffi/src/wallet.rs +++ b/crates/cdk-ffi/src/wallet.rs @@ -404,7 +404,7 @@ impl Wallet { } /// BIP353 methods for Wallet -#[cfg(all(feature = "bip353", not(target_arch = "wasm32")))] +#[cfg(not(target_arch = "wasm32"))] #[uniffi::export(async_runtime = "tokio")] impl Wallet { /// Get a quote for a BIP353 melt @@ -426,7 +426,6 @@ impl Wallet { } /// Auth methods for Wallet -#[cfg(feature = "auth")] #[uniffi::export(async_runtime = "tokio")] impl Wallet { /// Set Clear Auth Token (CAT) for authentication