Cleanup webauthn features (#3285)

This commit is contained in:
Firstyear 2024-12-12 21:56:12 +10:00 committed by GitHub
parent 4ee9a3a098
commit 60cc830ebd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 8 deletions

View file

@ -284,7 +284,6 @@ uuid = "^1.11.0"
webauthn-authenticator-rs = { version = "0.5.0", features = [ webauthn-authenticator-rs = { version = "0.5.0", features = [
"softpasskey", "softpasskey",
"softtoken", "softtoken",
"mozilla",
] } ] }
webauthn-rs = { version = "0.5.0", features = ["preview-features"] } webauthn-rs = { version = "0.5.0", features = ["preview-features"] }
webauthn-rs-core = "0.5.0" webauthn-rs-core = "0.5.0"

View file

@ -78,9 +78,25 @@ url = { workspace = true }
workspace = true workspace = true
features = ["win10"] features = ["win10"]
[target."cfg(not(any(target_os = \"windows\")))".dependencies.webauthn-authenticator-rs] [target."cfg(target_os = \"linux\")".dependencies.webauthn-authenticator-rs]
workspace = true workspace = true
features = ["u2fhid"] features = [
"u2fhid",
"mozilla",
]
[target."cfg(target_os = \"macos\")".dependencies.webauthn-authenticator-rs]
workspace = true
features = [
"u2fhid",
"mozilla",
]
[target."cfg(target_os = \"freebsd\")".dependencies.webauthn-authenticator-rs]
workspace = true
features = [
"mozilla",
]
## Debian packaging ## Debian packaging
[package.metadata.deb] [package.metadata.deb]

View file

@ -1,6 +1,16 @@
#[cfg(not(any(target_os = "windows")))] #[cfg(target_os = "linux")]
mod u2fhid;
#[cfg(target_os = "linux")]
use u2fhid::get_authenticator_backend;
#[cfg(target_os = "macos")]
mod mozilla; mod mozilla;
#[cfg(not(any(target_os = "windows")))] #[cfg(target_os = "macos")]
use mozilla::get_authenticator_backend;
#[cfg(target_os = "freebsd")]
mod mozilla;
#[cfg(target_os = "freebsd")]
use mozilla::get_authenticator_backend; use mozilla::get_authenticator_backend;
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]

View file

@ -1,5 +1,5 @@
use webauthn_authenticator_rs::u2fhid::U2FHid; use webauthn_authenticator_rs::mozilla::MozillaAuthenticator;
pub fn get_authenticator_backend() -> U2FHid { pub fn get_authenticator_backend() -> MozillaAuthenticator {
U2FHid::new() MozillaAuthenticator::default()
} }

View file

@ -0,0 +1,5 @@
use webauthn_authenticator_rs::u2fhid::U2FHid;
pub fn get_authenticator_backend() -> U2FHid {
U2FHid::new()
}