about summary refs log tree commit diff
path: root/kittybox-rs/src/indieauth/backend
diff options
context:
space:
mode:
Diffstat (limited to 'kittybox-rs/src/indieauth/backend')
-rw-r--r--kittybox-rs/src/indieauth/backend/fs.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/kittybox-rs/src/indieauth/backend/fs.rs b/kittybox-rs/src/indieauth/backend/fs.rs
index fbfa0f7..57bc3bd 100644
--- a/kittybox-rs/src/indieauth/backend/fs.rs
+++ b/kittybox-rs/src/indieauth/backend/fs.rs
@@ -7,6 +7,7 @@ use kittybox_indieauth::{
 };
 use serde::de::DeserializeOwned;
 use tokio::{task::spawn_blocking, io::AsyncReadExt};
+#[cfg(feature = "webauthn")]
 use webauthn::prelude::{Passkey, PasskeyRegistration, PasskeyAuthentication};
 
 const CODE_LENGTH: usize = 16;
@@ -343,15 +344,18 @@ impl AuthBackend for FileBackend {
     }
 
     // WebAuthn credential management.
+    #[cfg(feature = "webauthn")]
     async fn enroll_webauthn(&self, website: &url::Url, credential: Passkey) -> Result<()> {
         todo!()
     }
 
+    #[cfg(feature = "webauthn")]
     async fn list_webauthn_pubkeys(&self, website: &url::Url) -> Result<Vec<Passkey>> {
         // TODO stub!
         Ok(vec![])
     }
 
+    #[cfg(feature = "webauthn")]
     async fn persist_registration_challenge(
         &self,
         website: &url::Url,
@@ -360,6 +364,7 @@ impl AuthBackend for FileBackend {
         todo!()
     }
 
+    #[cfg(feature = "webauthn")]
     async fn retrieve_registration_challenge(
         &self,
         website: &url::Url,
@@ -368,6 +373,7 @@ impl AuthBackend for FileBackend {
         todo!()
     }
 
+    #[cfg(feature = "webauthn")]
     async fn persist_authentication_challenge(
         &self,
         website: &url::Url,
@@ -376,6 +382,7 @@ impl AuthBackend for FileBackend {
         todo!()
     }
 
+    #[cfg(feature = "webauthn")]
     async fn retrieve_authentication_challenge(
         &self,
         website: &url::Url,
@@ -392,12 +399,13 @@ impl AuthBackend for FileBackend {
                                   .join("password"))
             .await
         {
-            Ok(metadata) => creds.push(EnrolledCredential::Password),
+            Ok(_) => creds.push(EnrolledCredential::Password),
             Err(err) => if err.kind() != std::io::ErrorKind::NotFound {
                 return Err(err)
             }
         }
 
+        #[cfg(feature = "webauthn")]
         if !self.list_webauthn_pubkeys(website).await?.is_empty() {
             creds.push(EnrolledCredential::WebAuthn);
         }