Private
Public Access
1
0

implements authentication/token retrieval/keyring

This commit is contained in:
2025-05-03 01:06:50 -07:00
parent 461c37bd20
commit 26d54f91d5
11 changed files with 234 additions and 99 deletions

View File

@@ -115,7 +115,6 @@ impl DbusSettings for ServerImpl {
Event::UpdateSettings(Settings {
server_url: Some(url),
username: Some(user),
credential_item: None,
token: None,
}, r)
)
@@ -131,7 +130,6 @@ impl DbusSettings for ServerImpl {
Event::UpdateSettings(Settings {
server_url: Some(value),
username: None,
credential_item: None,
token: None,
}, r)
)
@@ -147,28 +145,10 @@ impl DbusSettings for ServerImpl {
Event::UpdateSettings(Settings {
server_url: None,
username: Some(value),
credential_item: None,
token: None,
}, r)
)
}
fn credential_item(&self) -> Result<dbus::Path<'static>, dbus::MethodErr> {
self.send_event_sync(Event::GetAllSettings)
.map(|settings| settings.credential_item.unwrap_or_default()).map(|item| dbus::Path::new(item).unwrap_or_default())
}
fn set_credential_item(&self, value: dbus::Path<'static>) -> Result<(), dbus::MethodErr> {
self.send_event_sync(|r|
Event::UpdateSettings(Settings {
server_url: None,
username: None,
credential_item: Some(value.to_string()),
token: None,
}, r)
)
}
}
fn run_sync_future<F, T>(f: F) -> Result<T, MethodErr>