Skip to content

Commit

Permalink
release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kingwingfly committed Aug 13, 2024
1 parent 8417b0e commit 1153274
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
-->

## [Unreleased]
## [1.0.0] - 2024-08-13

- update keyring to 3.0, removing linux only features

## [0.5.1] - 2024-08-02

- update doc
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["encrypt-config", "encrypt-config-derive", "tests", "examples"]
resolver = "2"

[workspace.package]
version = "0.5.1"
version = "1.0.0"
authors = ["Louis <[email protected]>"]
description = "A Rust crate to manage, persist and encrypt your configurations."
license = "MIT"
Expand All @@ -13,9 +13,9 @@ documentation = "https://docs.rs/encrypt-config"

[workspace.dependencies]
encrypt_config = { path = "encrypt-config", default-features = false }
encrypt_config_derive = { path = "encrypt-config-derive", default-features = false, version = "0.5.1" }
keyring = { version = "2.3", default-features = false }
rom_cache = { version = "0.0.9" }
encrypt_config_derive = { path = "encrypt-config-derive", default-features = false, version = "1.0.0" }
keyring = { version = "3.0.5", default-features = false }
rom_cache = { version = "0.0.10" }

[profile.dev.package.num-bigint-dig]
opt-level = 3
14 changes: 6 additions & 8 deletions encrypt-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ dirs = { version = "5.0.1", optional = true }
rom_cache = { workspace = true }

[target.'cfg(target_os = "macos")'.dependencies]
keyring = { workspace = true, optional = true, features = ["platform-macos"] }
keyring = { workspace = true, optional = true, features = ["apple-native"] }

[target.'cfg(target_os = "ios")'.dependencies]
keyring = { workspace = true, optional = true, features = ["platform-ios"] }
keyring = { workspace = true, optional = true, features = ["apple-native"] }

[target.'cfg(target_os = "linux")'.dependencies]
keyring = { workspace = true, optional = true }
keyring = { workspace = true, optional = true, features = ["linux-native"] }

[target.'cfg(target_os = "freebsd")'.dependencies]
keyring = { workspace = true, optional = true, features = ["platform-freebsd"] }
keyring = { workspace = true, optional = true, features = ["linux-native"] }

[target.'cfg(target_os = "openbsd")'.dependencies]
keyring = { workspace = true, optional = true, features = ["platform-openbsd"] }
keyring = { workspace = true, optional = true, features = ["linux-native"] }

[target.'cfg(target_os = "windows")'.dependencies]
keyring = { workspace = true, optional = true, features = ["platform-windows"] }
keyring = { workspace = true, optional = true, features = ["windows-native"] }

[features]
default = []
Expand All @@ -55,5 +55,3 @@ persist = ["encrypt_config_derive?/persist"]
derive = ["dep:encrypt_config_derive"]
default_config_dir = ["dep:dirs", "encrypt_config_derive?/default_config_dir"]
mock = []
linux-secret-service = ["keyring?/linux-secret-service"]
linux-keyutils = ["keyring?/linux-keyutils"]
14 changes: 3 additions & 11 deletions encrypt-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@
<!-- IMPORT -->
## Import
```toml
[target.'cfg(target_os = "linux")'.dependencies]
encrypt_config = { version = "0.5.0-alpha1", features = ["full", "linux-secret-service"] }

[target.'cfg(not(target_os = "linux"))'.dependencies]
encrypt_config = { version = "0.5.0-alpha1", features = ["full"] }
[dependencies]
encrypt_config = { version = "1.0.0", features = ["full"] }

[profile.dev.package.num-bigint-dig]
opt-level = 3
Expand Down Expand Up @@ -101,11 +98,6 @@ Moreover, as development progresses, a memory cache design is added for persiste
This leads this crate actually behaving more like bevy_ecs's resource system (or dependencies injecion with only args retrieving implemented).
The cache is released as an independent crate [rom_cache](https://crates.io/crates/rom_cache).

### Causion

One of `linux-secret-service` and `linux-keyutils` features should be enabled on Linux, or a compile error will be raised.


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


Expand Down Expand Up @@ -194,7 +186,7 @@ _For more examples, please refer to the [tests](https://github.com/kingwingfly/e

<!-- CHANGELOG -->
## Changelog

- 0.5.x -> 1.0.x: no feature difference between linux and others
- 0.4.x -> 0.5.x: Cache inside `Config` now behaves **totally** like a native cache. Changes will be saved as `Config` dropped automatically.
- v0.3.x -> v0.4.x: Cache inside `Config` now behaves more like a native cache. Changes will be saved as `ConfigMut` dropped automatically.
- v0.2.x -> v0.3.x: Now, multi-config-sources can be saved and loaded through `Config` in one go. But `add_xx_source`s are removed. By the way, one can defined their own sources by implementing `Source` trait while `NormalSource` `PersistSource` `SecretSource` are still provided.
Expand Down
31 changes: 0 additions & 31 deletions encrypt-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,6 @@
compile_error!("Feature `default_config_dir` only works with feature `persist` on.");
#[cfg(all(not(feature = "secret"), feature = "mock"))]
compile_error!("Feature `mock` is designed only for feature `secret` on.");
#[cfg(all(
target_os = "linux",
feature = "secret",
not(any(
feature = "linux-secret-service",
feature = "linux-keyutils",
feature = "mock"
))
))]
compile_error!("On Linux, there are two supported platform credential stores: the secret-service and the keyutils. You must enable one of the following features: `linux-secret-service` `linux-keyutils` `mock`.");
#[cfg(all(
target_os = "linux",
feature = "secret",
any(
all(feature = "linux-secret-service", feature = "linux-keyutils"),
all(feature = "linux-secret-service", feature = "mock"),
all(feature = "linux-keyutils", feature = "mock")
)
))]
compile_error!("On Linux, Only one of the following features can be enabled: `linux-secret-service` `linux-keyutils` `mock`.");
#[cfg(all(
target_os = "linux",
not(feature = "secret"),
any(feature = "linux-secret-service", feature = "linux-keyutils")
))]
compile_error!("On Linux, `linux-secret-service` `linux-keyutils` are only for `secret` on");
#[cfg(all(
not(target_os = "linux"),
any(feature = "linux-secret-service", feature = "linux-keyutils"),
))]
compile_error!("`linux-secret-service` `linux-keyutils` are only for Linux.");

/// The output directory for the generated files when testing.
pub const TEST_OUT_DIR: &str = concat!(env!("OUT_DIR"), "/encrypt_config_cache");
Expand Down

0 comments on commit 1153274

Please sign in to comment.