implements authentication/token retrieval/keyring
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user