Skip to content

Commit

Permalink
modified: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kingwingfly committed Dec 18, 2023
1 parent 31be2e7 commit 631c330
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "encrypt_config"
version = "0.0.1-alpha2"
version = "0.0.1-alpha3"
authors = ["Louis <[email protected]>"]
description = "A rust crate to manage, persist and encrypt your configurations."
license = "MIT"
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,24 @@
<!-- ABOUT THE PROJECT -->
## About The Project

A rust crate to manage, persist, encrypt configurations.
Sometimes, we need to store config in our application that we don't want to expose to the public. For example, the database password, the api key, etc.

One solution is to store them in the OS' secret manager, such as `Keychain` on macOS, `Credential Manager` on Windows, `libsecret` on Linux.

However, they usually have limitation on the secret length. For example, `Keychain` only allows 255 bytes for the secret, `Credential Manager` is even shorter. So we can't store a long secret in it.

Another solution is to store the secret in a file and encrypt it with a rsa public key, and store the private key in the OS' secret manager. This is what this crate does.

In other cases, maybe our secret is not a `String`, but a config `struct`. We can also use this crate to manage it. When invoke `Config::get`, it will deserialize the config from the cache and return it.

This crate provides 3 ways to manage your config:
- `Source`: A normal source, not persisted or encrypted
- `PersistSource`: A source that will be persisted to local file, not encrypted
- `SecretSource`: A source that will be persisted to local file and encrypted

This crate also has some optional features:
- `default_config_dir`: If enabled, the default config dir will be used.
- `protobuf`: If enabled, protobuf will be used instead of json for better performance. (Not implemented yet)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Expand Down

0 comments on commit 631c330

Please sign in to comment.