api,sink: mask sink uri secrets - #5093
Conversation
Signed-off-by: dongmen <414110582@qq.com>
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR adds utility functions to mask sensitive sink URI parameters and integrates them throughout changefeed validation paths to prevent credential exposure in error logs and API responses. Changes span utility functions, API handlers, sink adapters, and validation layers. ChangesSink URI Secret Masking
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request implements sensitive data masking for SinkURI in error messages across several components, including OpenAPI v2 handlers, sink adapters, and cluster checks. It introduces utility functions to redact credentials from URIs and adds comprehensive unit tests for this logic. The reviewer feedback highlights that the current implementation often discards the underlying error context when masking the URI, which can hinder debuggability for non-sensitive parsing failures. It is recommended to wrap the original error while still masking the URI string to preserve diagnostic information.
[LGTM Timeline notifier]Timeline:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3AceShowHand, flowbehappy, wk989898 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 |
| return changefeedDisplayName, true | ||
| } | ||
|
|
||
| func maskSinkURIForError(sinkURI string) string { |
There was a problem hiding this comment.
This 2 method is only a think wrapper about other method, useless.
|
/cherry-pick release-8.5 |
|
@asddongmen: new pull request created to branch DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #5094
What is changed and how it works?
This PR masks sensitive sink URI data before sink validation errors reach the OpenAPI request log. It covers changefeed create, update, resume, verify-table, and shared sink parse/unknown scheme paths. It also avoids logging parse errors inside URI masking helpers and adds tests for masked query secrets and malformed
URIs containing userinfo passwords.
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note
Summary by CodeRabbit
Security
Tests