Redact credentials from connection configuration logs - #1992
Conversation
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
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 V2ConnectConfigand V1ConnectParam. - 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.
Codecov Report❌ Patch coverage is
❌ 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@@ Coverage Diff @@
## master #1992 +/- ##
=========================================
Coverage ? 65.10%
Complexity ? 4263
=========================================
Files ? 473
Lines ? 26442
Branches ? 2510
=========================================
Hits ? 17215
Misses ? 7870
Partials ? 1357
🚀 New features to boost your workflow:
|
Signed-off-by: yhmo <yihua.mo@zilliz.com>
Uh oh!
There was an error while loading. Please reload this page.