Secret Service
Secret Service Rust library.
Interfaces with the Linux Secret Service API through dbus.
This library is feature complete but still in experimental stage.
Documentation
Basic Usage
Requires dbus and gmp development libraries installed (see Advanced section if you need to disable gmp).
On ubuntu, requires libdbus-1-dev and libgmp-dev.
In Cargo.toml:
[dependencies]
secret-service = "0.4.0"
If you have cargo-extras installed, can replace above step with the command at the prompt in your project directory:
$ cargo add secret-service
In source code (below example is for --bin, not --lib)
extern crate secret_service;
use SecretService;
use EncryptionType;
Functionality
- SecretService: initialize dbus, create plain/encrypted session.
- Collections: create, delete, search.
- Items: create, delete, search, get/set secret.
Advanced
It is possible to disable the dependency on libgmp by disabling the default
features in your Cargo.toml file:
[dependencies]
secret-service = { version = "^0.4", default-features = false }
Note: this will build the library without support for creating encrypted connections
to dbus, EncryptionType::Dh will be unavailable.
In many cases this is OK, as dbus encryption is primarily intended to prevent secrets
from being swapped to disk.
Use EncryptionType::Plain when gmp is disabled.
Changelog
0.4.0
- gmp is now optional dependency
- gmp upgraded to 0.3 to fix "private-in-public" warnings which will be hard errors soon.
Todo
- use
map_err(|_| SsError::Parse)forinner()? can'ttry!becauseinner()doesn't return an Error type in the Result. Or justunwrap()? - some refactoring (a list is in lib.rs)
- clear failed tests? (there is no "after" currently)
- move tests to integration tests?
- Should/can struct instances be deleted when dbus object is deleted?
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.