Expand description
A Secret Service implementation.
That is usually done with
use oo7::dbus::Service;
let service = Service::new().await?;
let mut attributes = std::collections::HashMap::new();
attributes.insert("type", "password");
attributes.insert("user_id", "some_other_identifier");
let collection = service.default_collection().await?;
// Store a secret
collection
.create_item("My App's secret", &attributes, "password", true, None)
.await?;
// Retrieve it later thanks to it attributes
let items = collection.search_items(&attributes).await?;
let item = items.first().unwrap();
assert_eq!(item.secret().await?, oo7::Secret::text("password"));
§Timeout
If a DBus method call takes longer than 30 seconds (for example, waiting for
user input on a prompt), the call will fail with a
zbus::Error::InputOutput(std::io::Error(kind: ErrorKind::TimedOut)).
Modules§
- api
unstable - Barebone DBus API of the Secret Service specifications.
Structs§
- Collection
- A collection allows to store and retrieve items.
- Item
- A secret with a label and attributes to identify it.
- Service
- The entry point of communicating with a
org.freedesktop.Secretsimplementation.
Enums§
- Algorithm
unstable - Algorithm used to start a new session.
- Error
- DBus backend specific errors.
- Service
Error - DBus Secret Service specific errors. https://specifications.freedesktop.org/secret-service-spec/latest/errors.html