Skip to content

refactor(sermant-agentcore): 重构 Nacos 客户端获取 token 逻辑#1802

Closed
wuqiu-ai wants to merge 2 commits into
sermant-io:developfrom
wuqiu-ai:develop
Closed

refactor(sermant-agentcore): 重构 Nacos 客户端获取 token 逻辑#1802
wuqiu-ai wants to merge 2 commits into
sermant-io:developfrom
wuqiu-ai:develop

Conversation

@wuqiu-ai
Copy link
Copy Markdown

@wuqiu-ai wuqiu-ai commented Jul 24, 2025

  • 支持低版本Nacos服务端的支持
  • 移除对 HttpLoginProcessor 和 NamingHttpClientManager 的依赖
  • 直接使用 HTTP POST 请求登录接口获取 token
  • 优化 token 刷新逻辑,提高代码可读性和可维护性

What type of PR is this?

What this PR does / why we need it?

Describe it.

Which issue(s) this PR fixes?

Fixes #

Does this PR introduce a user-facing change?

No

Checklist

  • Make sure there is a GitHub_issue related with this PR before you start working on it.
  • Make sure you have squashed your change to one single commit.
  • GitHub Actions works fine in this PR.

- 移除对 HttpLoginProcessor 和 NamingHttpClientManager 的依赖
- 直接使用 HTTP POST 请求登录接口获取 token
- 优化 token 刷新逻辑,提高代码可读性和可维护性
* @return response body
* @throws IOException IO exception during service invocation process
*/
private String doPost(String url, Map<String, String> formParams, boolean returnStatusWhenHasError)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In What Scenarios Is a StatusCode Return Required When an Invoking Failure Occurs?

@hanbingleixue hanbingleixue added area/framework Issues or PRs releated to sermant core service kind/enhancement Issues or PRs releated to sermant enhancement labels Jul 25, 2025
@lilai23
Copy link
Copy Markdown
Collaborator

lilai23 commented Jul 25, 2025

sign DCO in your commit, you can refer this https://sermant.io/zh/document/community/contributing.html

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 25, 2025

Codecov Report

❌ Patch coverage is 75.67568% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ement/service/dynamicconfig/nacos/NacosClient.java 75.67% 6 Missing and 3 partials ⚠️
Flag Coverage Δ Complexity Δ
unittests 27.41% <75.67%> (+0.04%) 352.00 <0.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ Complexity Δ
...ement/service/dynamicconfig/nacos/NacosClient.java 57.14% <75.67%> (+4.20%) 0.00 <0.00> (ø)

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Move lastRefreshTime update to prevent potential exception issues
- Use MapUtils.isEmpty() for consistent null and empty checks
- Add null check for response entity in error logging
- Add missing import for MapUtils
@wuqiu-ai wuqiu-ai closed this Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/framework Issues or PRs releated to sermant core service kind/enhancement Issues or PRs releated to sermant enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants