Skip to content

Commit 90c8d49

Browse files
authored
bump: upgrade nacos-sdk=0.4.2, with nacos-macro=0.1.1 (#246)
1 parent f8922e1 commit 90c8d49

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# 变更日志 | Change log
22

3+
### 0.4.2
4+
5+
- 功能: 提供 Aliyun ram AuthPlugin,通过 `features = ["auth-plugin-http"]` 开启
6+
7+
---
8+
9+
- Feature: Support Aliyun ram AuthPlugin (#245), enabled with `features = ["auth-plugin-http"]`
10+
311
### 0.4.1
412

513
- 优化: 在 `auth-plugin-http` 使用 `arc-swap` 替换 unsafe 代码

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
[package]
2020
name = "nacos-sdk"
21-
version = "0.4.1"
21+
version = "0.4.2"
2222
edition = "2021"
2323
authors = ["nacos-group", "CheirshCai <[email protected]>", "onewe <[email protected]>"]
2424
license = "Apache-2.0"
@@ -47,7 +47,7 @@ auth-by-aliyun = ["ring", "base64", "chrono"]
4747

4848
[dependencies]
4949
arc-swap = "1.7"
50-
nacos-macro = { version = "0.1.0", path = "nacos-macro" }
50+
nacos-macro = { version = "0.1.1", path = "nacos-macro" }
5151
thiserror = "1.0"
5252
tokio = { version = "1", features = ["full"] }
5353

nacos-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nacos-macro"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2021"
55
authors = ["nacos-group", "CheirshCai <[email protected]>", "onewe <[email protected]>"]
66
license = "Apache-2.0"

src/api/props.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ impl ClientProps {
9797
pub(crate) fn get_auth_context(&self) -> HashMap<String, String> {
9898
let mut auth_context = self.auth_context.clone();
9999
if self.env_first {
100+
#[cfg(feature = "auth-by-http")]
100101
self.get_http_auth_context(&mut auth_context);
102+
#[cfg(feature = "auth-by-aliyun")]
101103
self.get_aliyun_auth_context(&mut auth_context);
102104
}
103105
auth_context
@@ -113,9 +115,6 @@ impl ClientProps {
113115
}
114116
}
115117

116-
#[cfg(not(feature = "auth-by-http"))]
117-
fn get_http_auth_context(&self, context: &mut HashMap<String, String>) {}
118-
119118
#[cfg(feature = "auth-by-aliyun")]
120119
fn get_aliyun_auth_context(&self, context: &mut HashMap<String, String>) {
121120
if let Some(ak) = get_value_option(ENV_NACOS_CLIENT_AUTH_ACCESS_KEY) {
@@ -129,9 +128,6 @@ impl ClientProps {
129128
}
130129
}
131130

132-
#[cfg(not(feature = "auth-by-aliyun"))]
133-
fn get_aliyun_auth_context(&self, context: &mut HashMap<String, String>) {}
134-
135131
pub(crate) fn get_server_list(&self) -> crate::api::error::Result<Vec<String>> {
136132
let server_addr = self.get_server_addr();
137133
if server_addr.trim().is_empty() {

0 commit comments

Comments
 (0)