6 releases (stable)

4.0.3 Oct 13, 2024
4.0.2 Jul 23, 2024
4.0.1 Jul 10, 2024
4.0.0 Jul 6, 2024
4.0.0-rc.2 Jul 5, 2024

#2 in #api-secret

Download history 6287/week @ 2024-07-23 4050/week @ 2024-07-30 5709/week @ 2024-08-06 6599/week @ 2024-08-13 6785/week @ 2024-08-20 6884/week @ 2024-08-27 8516/week @ 2024-09-03 5738/week @ 2024-09-10 5915/week @ 2024-09-17 6009/week @ 2024-09-24 7670/week @ 2024-10-01 8822/week @ 2024-10-08 8882/week @ 2024-10-15 7043/week @ 2024-10-22 7860/week @ 2024-10-29 5454/week @ 2024-11-05

31,680 downloads per month
Used in 35 crates (via keyring)

MIT/Apache

88KB
1.5K SLoC

dbus-secret-service

build dependencies crates.io docs.rs

This crate is a knock-off of the hwchen/secret-service crate, which is currently at version 4 and uses zbus to access the secret service. The basic collection, item and search APIs in this crate are meant to work the same as the blocking APIs in the zbus-based crate. If they don't, please file a bug.

Why do a knock-off? So that folks who write synchronous Rust apps that access the secret service (typically through the hwchen/keyring crate) are not required to add an async runtime. Because this knock-off uses lib-dbus, it doesn't require an async runtime.

Why is this crate starting at version 4? Since its API matches a particular version of the dbus-based crate, I figured it would be clearest if its version number matched that version as well.

Usage

For code usage examples, see the documentation.

This crate has no default features, and requires no features to run. If you need your secrets to be encrypted on their way to and from the secret service, then add one of the crypto features:

  • crypto-rust uses pure Rust crates for encryption.
  • crypto-openssl uses the openssl libraries for encryption (which must be installed).

See the documentation for details on how to specify use of an encrypted session.

To build a project that uses this crate, your development machine will need to have the dbus development headers installed, and the openssl development headers for the crypto-openssl feature. To run an application that uses this crate, your machine will need to have libdbus installed (almost all do), and the openssl libraries for the crypto-openssl feature. If you want to avoid this runtime requirement, you can specify the vendored feature at build time: this will statically link the needed libraries with your executable.

Functionality

  • SecretService: initialize dbus, create plain/encrypted session.
  • Collections: create, delete, search.
  • Items: create, delete, search, get/set secret.

Changelog

v4.0.0: first release, same API as secret-service v4.0.

License

The copyright to all material in this repository belongs to the collective of contributors who have checked material into this repository.

All material is this repository is licensed under either of

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.

Dependencies

~8MB
~168K SLoC