robius-authentication 0.3.0

Rust abstractions for multi-platform native authentication: biometrics, fingerprint, password, screen lock, TouchID, FaceID, Windows Hello, etc.
Documentation
[package]
name = "robius-authentication"
version.workspace = true
edition.workspace = true
rust-version = "1.77.0"
authors = [
    "Kevin Boos <kevinaboos@gmail.com>",
    "Klim Tsoutsman <klim@tsoutsman.com>",
    "Tyrese Luo <tyreseluo@outlook.com>",
    "Project Robius Maintainers",
]
description = "Rust abstractions for multi-platform native authentication: biometrics, fingerprint, password, screen lock, TouchID, FaceID, Windows Hello, etc."
documentation = "https://docs.rs/robius-authentication"
homepage.workspace = true
keywords = ["robius", "authentication", "biometric", "password", "fingerprint"]
categories.workspace = true
license.workspace = true
repository.workspace = true
readme = "README.md"


## Note: ideally this would be only included when we're building for Android,
## but Cargo doesn't support target-specific build scripts yet.
## See: <https://github.com/rust-lang/cargo/issues/4932> and
## <https://github.com/rust-lang/cargo/issues/14378#issuecomment-2278333431>.
## We cannot simply use `cfg(target_os = "android")` here,
## because the build script's notion of a "target" is that of the HOST system,
## not the target. So if we were to use `cfg(target_os = "android")` here,
## it would only take effect when building on an Android host itself, which never happens.
[build-dependencies]
android-build.workspace = true

[dependencies]
cfg-if.workspace = true

[target.'cfg(target_os = "android")'.dependencies]
jni.workspace = true
robius-android-env.workspace = true

[target.'cfg(target_vendor = "apple")'.dependencies]
block2.workspace = true
objc2.workspace = true
objc2-local-authentication = { workspace = true, features = ["block2", "LAContext", "LAError"] }
objc2-foundation = { workspace = true, features = ["NSError", "NSString"] }


## disabled for now, sync the `async` feature isn't fully implemented.
# [target.'cfg(any(target_vendor = "apple", target_os = "android"))'.dependencies.tokio]
# version = "1.35.1"
# default-features = false
# features = ["sync"]
# optional = true

[target.'cfg(target_os = "linux")'.dependencies]
zbus.workspace = true
zbus_polkit = { workspace = true }

[target.'cfg(target_os = "windows")'.dependencies]
retry.workspace = true
windows-core = { workspace = true }
windows = { workspace = true, features = [
    # For UWP-based authentication.
    "Foundation",
    "Security_Credentials_UI",
    # WinRT
    "Win32_UI_WindowsAndMessaging",
    "Win32_System_WinRT",
    "Win32_System_Com",
    # Fallback
    "Win32_Foundation",
    "Win32_Graphics_Gdi",
    "Win32_NetworkManagement_NetManagement",
    "Win32_Security_Authentication_Identity",
    "Win32_Security_Credentials",
    "Win32_UI_Input_KeyboardAndMouse",
]}


[features]
default = []
## This feature is not fully implemented yet, do not use it.
##
## Enable this feature to expose non-blocking asynchronous authentication APIs.
#async = ["dep:tokio"]

## Note: there is a UWP feature still in the code,
## but enabling it causes the app to freeze on Windows 11 Pro.
## Everything still works correctly without the UWP feature.
# uwp = []