Skip to content

Commit 482069e

Browse files
Merge pull request #181 from brotskydotcom/master
Fill lines in README.
2 parents 28d1d01 + f98ccaf commit 482069e

File tree

1 file changed

+18
-46
lines changed

1 file changed

+18
-46
lines changed

README.md

+18-46
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,19 @@
55
[![crates.io](https://img.shields.io/crates/v/keyring.svg?style=flat-square)](https://crates.io/crates/keyring)
66
[![docs.rs](https://docs.rs/keyring/badge.svg)](https://docs.rs/keyring)
77

8-
A cross-platform library to manage storage and retrieval of passwords (and other secrets) in the underlying platform
9-
secure store, with a fully-developed example that provides a command-line interface.
8+
A cross-platform library to manage storage and retrieval of passwords (and other secrets) in the underlying platform secure store, with a fully-developed example that provides a command-line interface.
109

1110
## Usage
1211

13-
To use this crate in your project, you must include it in your `Cargo.toml` and specify a feature for each supported
14-
credential store you want to use. For example, if you want to use the platform credential stores on Mac and Win, and use
15-
the Secret Service (synchronously) on Linux and \*nix platforms, you would add a snippet such as this to
16-
your `[dependencies]` section:
12+
To use this crate in your project, you must include it in your `Cargo.toml` and specify a feature for each supported credential store you want to use. For example, if you want to use the platform credential stores on Mac and Win, and use the Secret Service (synchronously) on Linux and \*nix platforms, you would add a snippet such as this to your `[dependencies]` section:
1713

1814
```toml
1915
keyring = { version = "3", features = ["apple-native", "windows-native", "sync-secret-service"] }
2016
```
2117

22-
This will give you access to the `keyring` crate in your code. Now you can use the `Entry::new` function to create a new
23-
keyring entry. The `new` function takes a service name and a user's name which together identify the entry.
18+
This will give you access to the `keyring` crate in your code. Now you can use the `Entry::new` function to create a new keyring entry. The `new` function takes a service name and a user's name which together identify the entry.
2419

25-
Passwords (strings) or secrets (binary data) can be added to an entry using its `set_password` or `set_secret` methods,
26-
respectively. (These methods create an entry in the underlying credential store.) The password or secret can then be
27-
read back using the `get_password` or `get_secret` methods. The underlying credential (with its password/secret data)
28-
can then be removed using the `delete_credential` method.
20+
Passwords (strings) or secrets (binary data) can be added to an entry using its `set_password` or `set_secret` methods, respectively. (These methods create an entry in the underlying credential store.) The password or secret can then be read back using the `get_password` or `get_secret` methods. The underlying credential (with its password/secret data) can then be removed using the `delete_credential` method.
2921

3022
```rust
3123
use keyring::{Entry, Result};
@@ -42,32 +34,23 @@ fn main() -> Result<()> {
4234

4335
## Errors
4436

45-
Creating and operating on entries can yield a `keyring::Error` which provides both a platform-independent code that
46-
classifies the error and, where relevant, underlying platform errors or more information about what went wrong.
37+
Creating and operating on entries can yield a `keyring::Error` which provides both a platform-independent code that classifies the error and, where relevant, underlying platform errors or more information about what went wrong.
4738

4839
## Examples
4940

5041
The keychain-rs project contains a sample application (`keyring-cli`) and a sample library (`ios`).
5142

52-
The `keyring-cli` application is a command-line interface to the full functionality of the keyring. Invoke it without
53-
arguments to see usage information. It handles binary data input and output using base64 encoding. It can be installed
54-
using `cargo install` and used to experiment with library functionality. It can also be used when debugging
55-
keyring-based applications to probe the contents of the credential store; just be sure to build it using the same
56-
features/credential stores that are used by your application.
43+
The `keyring-cli` application is a command-line interface to the full functionality of the keyring. Invoke it without arguments to see usage information. It handles binary data input and output using base64 encoding. It can be installed using `cargo install` and used to experiment with library functionality. It can also be used when debugging keyring-based applications to probe the contents of the credential store; just be sure to build it using the same features/credential stores that are used by your application.
5744

58-
The `ios` library is a full exercise of all the iOS functionality; it's meant to be loaded into an iOS test harness such
59-
as the one found in [this project](https://github.com/brotskydotcom/rust-on-ios). While the library can be compiled and
60-
linked to on macOS as well, doing so doesn't provide any advantages over using the crate directly.
45+
The `ios` library is a full exercise of all the iOS functionality; it's meant to be loaded into an iOS test harness such as the one found in [this project](https://github.com/brotskydotcom/rust-on-ios). While the library can be compiled and linked to on macOS as well, doing so doesn't provide any advantages over using the crate directly.
6146

6247
## Client Testing
6348

64-
This crate comes with a mock credential store that can be used by clients who want to test without accessing the native
65-
platform store. The mock store is cross-platform and allows mocking errors as well as successes.
49+
This crate comes with a mock credential store that can be used by clients who want to test without accessing the native platform store. The mock store is cross-platform and allows mocking errors as well as successes.
6650

6751
## Extensibility
6852

69-
This crate allows clients to "bring their own credential store" by providing traits that clients can implement. See
70-
the [developer docs](https://docs.rs/keyring/) for details.
53+
This crate allows clients to "bring their own credential store" by providing traits that clients can implement. See the [developer docs](https://docs.rs/keyring/) for details.
7154

7255
## Platforms
7356

@@ -78,30 +61,21 @@ This crate provides built-in implementations of the following platform-specific
7861
* _macOS_, _iOS_: The local keychain.
7962
* _Windows_: The Windows Credential Manager.
8063

81-
To enable the stores you want, you use features. If you don't enable any stores for a given platform, the _mock_
82-
keystore will be used. See the [developer docs](https://docs.rs/keyring/) for details.
64+
To enable the stores you want, you use features. If you don't enable any stores for a given platform, the _mock_ keystore will be used. See the [developer docs](https://docs.rs/keyring/) for details.
8365

84-
Please note: Since neither the maintainers nor GitHub do testing on BSD variants, we rely on contributors to support
85-
these platforms. Thanks for your help!
66+
Please note: Since neither the maintainers nor GitHub do testing on BSD variants, we rely on contributors to support these platforms. Thanks for your help!
8667

8768
## Upgrading from v2
8869

89-
The major functional change between v2 and v3 is the addition of synchronous support for the Secret Service via
90-
the [dbus-secret-service crate](https://crates.io/crates/dbus-secret-service). This means that keyring users of the
91-
Secret Service no longer need to link with an async runtime.
70+
The major functional change between v2 and v3 is the addition of synchronous support for the Secret Service via the [dbus-secret-service crate](https://crates.io/crates/dbus-secret-service). This means that keyring users of the Secret Service no longer need to link with an async runtime.
9271

93-
The main API change between v2 and v3 is the addition of support for non-string (i.e., binary) "password" data. To
94-
accommodate this, two changes have been made:
72+
The main API change between v2 and v3 is the addition of support for non-string (i.e., binary) "password" data. To accommodate this, two changes have been made:
9573

96-
1. There are two new methods on `Entry` objects: `set_secret` and `get_secret`. These are the analogs of `set_password`
97-
and `get_password`, but instead of taking or returning strings they take or return binary data (byte arrays/vectors).
74+
1. There are two new methods on `Entry` objects: `set_secret` and `get_secret`. These are the analogs of `set_password` and `get_password`, but instead of taking or returning strings they take or return binary data (byte arrays/vectors).
9875

99-
2. The v2 method `delete_password` has been renamed `delete_credential`, both to clarify what's actually being deleted
100-
and to emphasize that it doesn't matter whether it's holding a "password" or a "secret".
76+
2. The v2 method `delete_password` has been renamed `delete_credential`, both to clarify what's actually being deleted and to emphasize that it doesn't matter whether it's holding a "password" or a "secret".
10177

102-
Another API change between v2 and v3 is that the notion of a default feature set has gone away: you must now specify
103-
explicitly which crate-supported keystores you want included (other than the `mock` keystore, which is always present).
104-
So all keyring client developers will need to update their `Cargo.toml` file to use the new features correctly.
78+
Another API change between v2 and v3 is that the notion of a default feature set has gone away: you must now specify explicitly which crate-supported keystores you want included (other than the `mock` keystore, which is always present). So all keyring client developers will need to update their `Cargo.toml` file to use the new features correctly.
10579

10680
All v2 data is fully forward-compatible with v3 data; there have been no changes at all in that respect.
10781

@@ -118,8 +92,7 @@ at your option.
11892

11993
## Contributors
12094

121-
Thanks to the following for helping make this library better, whether through contributing code, discussion, or bug
122-
reports!
95+
Thanks to the following for helping make this library better, whether through contributing code, discussion, or bug reports!
12396

12497
- @Alexei-Barnes
12598
- @benwr
@@ -158,5 +131,4 @@ If you should be on this list, but don't find yourself, please contact @brotskyd
158131

159132
### Contribution
160133

161-
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as
162-
defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
134+
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.

0 commit comments

Comments
 (0)