Prepare public release v0.1.0
This commit is contained in:
@@ -12,7 +12,7 @@ mod detection;
|
||||
|
||||
use linux_hello_common::{Config, Result, TemplateStore};
|
||||
use linux_hello_daemon::auth::AuthService;
|
||||
use linux_hello_daemon::dbus_server::{DbusServer, check_system_bus_available};
|
||||
use linux_hello_daemon::dbus_server::{check_system_bus_available, DbusServer};
|
||||
use linux_hello_daemon::ipc::IpcServer;
|
||||
use tracing::{error, info, warn, Level};
|
||||
use tracing_subscriber::FmtSubscriber;
|
||||
@@ -71,39 +71,33 @@ async fn main() -> Result<()> {
|
||||
let auth_service_for_auth = auth_service.clone();
|
||||
ipc_server.set_auth_handler(move |user| {
|
||||
let auth_service = auth_service_for_auth.clone();
|
||||
async move {
|
||||
auth_service.authenticate(&user).await
|
||||
}
|
||||
async move { auth_service.authenticate(&user).await }
|
||||
});
|
||||
|
||||
// Set enrollment handler
|
||||
let auth_service_for_enroll = auth_service.clone();
|
||||
ipc_server.set_enroll_handler(move |user, label, frame_count| {
|
||||
let auth_service = auth_service_for_enroll.clone();
|
||||
async move {
|
||||
auth_service.enroll(&user, &label, frame_count).await
|
||||
}
|
||||
async move { auth_service.enroll(&user, &label, frame_count).await }
|
||||
});
|
||||
|
||||
// Set list handler
|
||||
ipc_server.set_list_handler(move |user| {
|
||||
async move {
|
||||
let store = TemplateStore::new(TemplateStore::default_path());
|
||||
store.list_templates(&user)
|
||||
}
|
||||
ipc_server.set_list_handler(move |user| async move {
|
||||
let store = TemplateStore::new(TemplateStore::default_path());
|
||||
store.list_templates(&user)
|
||||
});
|
||||
|
||||
// Set remove handler
|
||||
ipc_server.set_remove_handler(move |user, label, all| {
|
||||
async move {
|
||||
let store = TemplateStore::new(TemplateStore::default_path());
|
||||
if all {
|
||||
store.remove_all(&user)
|
||||
} else if let Some(l) = label {
|
||||
store.remove(&user, &l)
|
||||
} else {
|
||||
Err(linux_hello_common::Error::Config("No label specified".to_string()))
|
||||
}
|
||||
ipc_server.set_remove_handler(move |user, label, all| async move {
|
||||
let store = TemplateStore::new(TemplateStore::default_path());
|
||||
if all {
|
||||
store.remove_all(&user)
|
||||
} else if let Some(l) = label {
|
||||
store.remove(&user, &l)
|
||||
} else {
|
||||
Err(linux_hello_common::Error::Config(
|
||||
"No label specified".to_string(),
|
||||
))
|
||||
}
|
||||
});
|
||||
|
||||
@@ -112,7 +106,10 @@ async fn main() -> Result<()> {
|
||||
let mut dbus_server = DbusServer::new();
|
||||
|
||||
if dbus_enabled {
|
||||
match dbus_server.start(auth_service.clone(), config.clone()).await {
|
||||
match dbus_server
|
||||
.start(auth_service.clone(), config.clone())
|
||||
.await
|
||||
{
|
||||
Ok(()) => {
|
||||
info!("D-Bus server started successfully");
|
||||
info!(" Service: org.linuxhello.Daemon");
|
||||
|
||||
Reference in New Issue
Block a user