Skip to content

Commit

Permalink
bump: upgrade nacos-sdk=0.4.2, with nacos-macro=0.1.1 (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
CherishCai authored Sep 13, 2024
1 parent f8922e1 commit 90c8d49
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 代码
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

[package]
name = "nacos-sdk"
version = "0.4.1"
version = "0.4.2"
edition = "2021"
authors = ["nacos-group", "CheirshCai <[email protected]>", "onewe <[email protected]>"]
license = "Apache-2.0"
Expand Down Expand Up @@ -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"] }

Expand Down
2 changes: 1 addition & 1 deletion nacos-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nacos-macro"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
authors = ["nacos-group", "CheirshCai <[email protected]>", "onewe <[email protected]>"]
license = "Apache-2.0"
Expand Down
8 changes: 2 additions & 6 deletions src/api/props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ impl ClientProps {
pub(crate) fn get_auth_context(&self) -> HashMap<String, String> {
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
Expand All @@ -113,9 +115,6 @@ impl ClientProps {
}
}

#[cfg(not(feature = "auth-by-http"))]
fn get_http_auth_context(&self, context: &mut HashMap<String, String>) {}

#[cfg(feature = "auth-by-aliyun")]
fn get_aliyun_auth_context(&self, context: &mut HashMap<String, String>) {
if let Some(ak) = get_value_option(ENV_NACOS_CLIENT_AUTH_ACCESS_KEY) {
Expand All @@ -129,9 +128,6 @@ impl ClientProps {
}
}

#[cfg(not(feature = "auth-by-aliyun"))]
fn get_aliyun_auth_context(&self, context: &mut HashMap<String, String>) {}

pub(crate) fn get_server_list(&self) -> crate::api::error::Result<Vec<String>> {
let server_addr = self.get_server_addr();
if server_addr.trim().is_empty() {
Expand Down

0 comments on commit 90c8d49

Please sign in to comment.