diff --git a/CHANGELOG.md b/CHANGELOG.md index b6d4c70..81e1925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # 变更日志 | Change log +### 0.4.2 + +- 功能: 提供 Aliyun ram AuthPlugin,通过 `features = ["auth-plugin-http"]` 开启 + +--- + +- Feature: Support Aliyun ram AuthPlugin (#245), enabled with `features = ["auth-plugin-http"]` + ### 0.4.1 - 优化: 在 `auth-plugin-http` 使用 `arc-swap` 替换 unsafe 代码 diff --git a/Cargo.toml b/Cargo.toml index 1cb2ea4..8478f3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ [package] name = "nacos-sdk" -version = "0.4.1" +version = "0.4.2" edition = "2021" authors = ["nacos-group", "CheirshCai <785427346@qq.com>", "onewe <2583021406@qq.com>"] license = "Apache-2.0" @@ -47,7 +47,7 @@ auth-by-aliyun = ["ring", "base64", "chrono"] [dependencies] arc-swap = "1.7" -nacos-macro = { version = "0.1.0", path = "nacos-macro" } +nacos-macro = { version = "0.1.1", path = "nacos-macro" } thiserror = "1.0" tokio = { version = "1", features = ["full"] } diff --git a/nacos-macro/Cargo.toml b/nacos-macro/Cargo.toml index 7846fe6..8fa28a1 100644 --- a/nacos-macro/Cargo.toml +++ b/nacos-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nacos-macro" -version = "0.1.0" +version = "0.1.1" edition = "2021" authors = ["nacos-group", "CheirshCai <785427346@qq.com>", "onewe <2583021406@qq.com>"] license = "Apache-2.0" diff --git a/src/api/props.rs b/src/api/props.rs index a575559..3c66753 100644 --- a/src/api/props.rs +++ b/src/api/props.rs @@ -97,7 +97,9 @@ impl ClientProps { pub(crate) fn get_auth_context(&self) -> HashMap { let mut auth_context = self.auth_context.clone(); if self.env_first { + #[cfg(feature = "auth-by-http")] self.get_http_auth_context(&mut auth_context); + #[cfg(feature = "auth-by-aliyun")] self.get_aliyun_auth_context(&mut auth_context); } auth_context @@ -113,9 +115,6 @@ impl ClientProps { } } - #[cfg(not(feature = "auth-by-http"))] - fn get_http_auth_context(&self, context: &mut HashMap) {} - #[cfg(feature = "auth-by-aliyun")] fn get_aliyun_auth_context(&self, context: &mut HashMap) { if let Some(ak) = get_value_option(ENV_NACOS_CLIENT_AUTH_ACCESS_KEY) { @@ -129,9 +128,6 @@ impl ClientProps { } } - #[cfg(not(feature = "auth-by-aliyun"))] - fn get_aliyun_auth_context(&self, context: &mut HashMap) {} - pub(crate) fn get_server_list(&self) -> crate::api::error::Result> { let server_addr = self.get_server_addr(); if server_addr.trim().is_empty() {