Skip to content

Redact credentials from connection configuration logs - #1992

Merged
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:mm
Aug 5, 2026
Merged

Redact credentials from connection configuration logs#1992
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:mm

Conversation

@yhmo

@yhmo yhmo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
  • Redact passwords, tokens, authorization values, and URI user-info from V1 and V2 diagnostic output.
  • Keep standalone usernames visible for authentication and RBAC troubleshooting.
  • Sanitize global-cluster endpoint logs throughout connection and topology refresh paths.
  • Centralize redaction logic in a shared utility and add regression coverage.

Copilot AI lite review requested due to automatic review settings August 4, 2026 09:06
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yhmo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify

mergify Bot commented Aug 4, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent accidental credential exposure by redacting sensitive fields (tokens/usernames/passwords/authorization) from configuration and request parameter toString() output, and adds regression tests to ensure redaction is preserved over time.

Changes:

  • Redact sensitive fields in toString() for V2 ConnectConfig and V1 ConnectParam.
  • Redact sensitive fields in toString() for credential request params (CreateCredentialParam, UpdateCredentialParam).
  • Add tests covering V2 config redaction and V1 connect/credential parameter redaction.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sdk-core/src/test/java/io/milvus/v2/client/MilvusClientV2Test.java Adds a regression test asserting V2 ConnectConfig.toString() redacts token/username/password.
sdk-core/src/test/java/io/milvus/param/CredentialRedactionTest.java New tests asserting redaction for ConnectParam, MultiConnectParam, and credential request params.
sdk-core/src/main/java/io/milvus/v2/client/ConnectConfig.java Redacts token/username/password in toString().
sdk-core/src/main/java/io/milvus/param/credential/UpdateCredentialParam.java Redacts username/oldPassword/newPassword in toString().
sdk-core/src/main/java/io/milvus/param/credential/CreateCredentialParam.java Redacts username/password in toString().
sdk-core/src/main/java/io/milvus/param/ConnectParam.java Redacts token/authorization/userName in toString().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sdk-core/src/main/java/io/milvus/param/ConnectParam.java Outdated
Comment thread sdk-core/src/main/java/io/milvus/v2/client/ConnectConfig.java Outdated
Comment thread sdk-core/src/test/java/io/milvus/param/CredentialRedactionTest.java
Comment thread sdk-core/src/test/java/io/milvus/param/CredentialRedactionTest.java
Comment thread sdk-core/src/main/java/io/milvus/param/credential/CreateCredentialParam.java Outdated
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@acab35b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../io/milvus/v2/client/globalcluster/GlobalStub.java 0.00% 5 Missing ⚠️
.../main/java/io/milvus/v2/client/MilvusClientV2.java 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (75.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1992   +/-   ##
=========================================
  Coverage          ?   65.10%           
  Complexity        ?     4263           
=========================================
  Files             ?      473           
  Lines             ?    26442           
  Branches          ?     2510           
=========================================
  Hits              ?    17215           
  Misses            ?     7870           
  Partials          ?     1357           
Files with missing lines Coverage Δ
.../java/io/milvus/common/utils/RedactCredential.java 100.00% <100.00%> (ø)
...re/src/main/java/io/milvus/param/ConnectParam.java 64.43% <100.00%> (ø)
...milvus/param/credential/CreateCredentialParam.java 72.72% <100.00%> (ø)
...milvus/param/credential/UpdateCredentialParam.java 73.33% <100.00%> (ø)
...c/main/java/io/milvus/v2/client/ConnectConfig.java 66.66% <100.00%> (ø)
...vus/v2/client/globalcluster/TopologyRefresher.java 53.48% <100.00%> (ø)
...o/milvus/v2/service/cdc/request/MilvusCluster.java 63.26% <100.00%> (ø)
.../milvus/v2/service/rbac/request/CreateUserReq.java 77.77% <100.00%> (ø)
...vus/v2/service/rbac/request/UpdatePasswordReq.java 75.60% <100.00%> (ø)
.../main/java/io/milvus/v2/client/MilvusClientV2.java 53.20% <0.00%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread sdk-core/src/main/java/io/milvus/v2/client/ConnectConfig.java
Comment thread sdk-core/src/test/java/io/milvus/v2/client/MilvusClientV2Test.java
Comment thread sdk-core/src/main/java/io/milvus/common/utils/RedactCredential.java Outdated
Signed-off-by: yhmo <yihua.mo@zilliz.com>
@mergify mergify Bot added ci-passed and removed ci-passed labels Aug 4, 2026
@yhmo yhmo added the lgtm label Aug 5, 2026
@sre-ci-robot
sre-ci-robot merged commit 71e6045 into milvus-io:master Aug 5, 2026
7 of 8 checks passed
@yhmo
yhmo deleted the mm branch August 5, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants