Parcourir la source

feat: remove features from auth (#1103)

thesimplekid il y a 3 semaines
Parent
commit
6b80b74cb1

+ 0 - 3
.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,

+ 1 - 6
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 }

+ 0 - 6
crates/cdk-ffi/src/types.rs

@@ -1998,7 +1998,6 @@ impl TryFrom<TransactionId> 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<cdk::nuts::AuthProof> for AuthProof {
     fn from(auth_proof: cdk::nuts::AuthProof) -> Self {
         Self {
@@ -2026,7 +2024,6 @@ impl From<cdk::nuts::AuthProof> for AuthProof {
     }
 }
 
-#[cfg(feature = "auth")]
 impl TryFrom<AuthProof> for cdk::nuts::AuthProof {
     type Error = FfiError;
 
@@ -2047,7 +2044,6 @@ impl TryFrom<AuthProof> for cdk::nuts::AuthProof {
     }
 }
 
-#[cfg(feature = "auth")]
 impl AuthProof {
     /// Convert AuthProof to JSON string
     pub fn to_json(&self) -> Result<String, FfiError> {
@@ -2056,14 +2052,12 @@ impl AuthProof {
 }
 
 /// Decode AuthProof from JSON string
-#[cfg(feature = "auth")]
 #[uniffi::export]
 pub fn decode_auth_proof(json: String) -> Result<AuthProof, FfiError> {
     Ok(serde_json::from_str(&json)?)
 }
 
 /// Encode AuthProof to JSON string
-#[cfg(feature = "auth")]
 #[uniffi::export]
 pub fn encode_auth_proof(proof: AuthProof) -> Result<String, FfiError> {
     Ok(serde_json::to_string(&proof)?)

+ 1 - 2
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