Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump: upgrade nacos-sdk=0.4.2, with nacos-macro=0.1.1 #246

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <785427346@qq.com>", "onewe <2583021406@qq.com>"]
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 <785427346@qq.com>", "onewe <2583021406@qq.com>"]
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
Loading