From 11532744978fd781c5e82881657acd3964dbab3f Mon Sep 17 00:00:00 2001 From: Louis <836250617@qq.com> Date: Tue, 13 Aug 2024 12:59:03 +0800 Subject: [PATCH] release v1.0.0 --- CHANGELOG.md | 4 ++++ Cargo.toml | 8 ++++---- encrypt-config/Cargo.toml | 14 ++++++-------- encrypt-config/README.md | 14 +++----------- encrypt-config/src/lib.rs | 31 ------------------------------- 5 files changed, 17 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9b8205..8f020b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Cargo.toml b/Cargo.toml index b46a77d..1249d3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 <836250617@qq.com>"] description = "A Rust crate to manage, persist and encrypt your configurations." license = "MIT" @@ -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 diff --git a/encrypt-config/Cargo.toml b/encrypt-config/Cargo.toml index 699e15f..6fb7c2e 100644 --- a/encrypt-config/Cargo.toml +++ b/encrypt-config/Cargo.toml @@ -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 = [] @@ -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"] diff --git a/encrypt-config/README.md b/encrypt-config/README.md index 14abb59..f3d6056 100644 --- a/encrypt-config/README.md +++ b/encrypt-config/README.md @@ -61,11 +61,8 @@ ## 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 @@ -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. - -
@@ -194,7 +186,7 @@ _For more examples, please refer to the [tests](https://github.com/kingwingfly/e ## 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. diff --git a/encrypt-config/src/lib.rs b/encrypt-config/src/lib.rs index 57a2db5..c2dbc69 100644 --- a/encrypt-config/src/lib.rs +++ b/encrypt-config/src/lib.rs @@ -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");