fix: fixed the issue where the data subscription configuration token was not working#105
fix: fixed the issue where the data subscription configuration token was not working#105
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the security and reliability of token handling and logging within the TMQ (Time-series Message Queue) client. It extends sensitive data masking capabilities to cover additional token types and refines how configuration objects are logged to prevent accidental exposure of credentials. The changes also ensure that connection tokens are consistently managed across different configuration sources. Furthermore, comprehensive integration tests have been introduced to validate these enhanced token-based authentication flows, ensuring the system behaves as expected under various conditions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR improves TMQ token authentication support and log redaction for the Node.js WebSocket TMQ consumer, with updated enterprise tests to cover token-based connections.
Changes:
- Adjust TMQ config handling so connect tokens are propagated via
otherConfigsand serialized correctly into TMQ subscribe requests. - Improve debug logging for
WsConsumerby emitting a masked, JSON-stringified TMQ config and expanding sensitive-field masking to includetd.connect.token. - Update TMQ integration tests to create/drop tokens per test and add coverage for token-in-config vs token-in-URL flows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
nodejs/test/bulkPulling/tmq.test.ts |
Refactors token tests to create/drop tokens and adds token-in-config/token-in-URL consumer scenarios. |
nodejs/src/tmq/wsTmq.ts |
Improves config logging and fixes otherConfigs serialization (Map → plain object) for subscribe payloads. |
nodejs/src/tmq/config.ts |
Ensures CONNECT_TOKEN (including URL bearer_token) is also stored in otherConfigs for downstream requests. |
nodejs/src/common/utils.ts |
Expands sensitive masking and changes TMQ config masking to return a JSON string with URL/token redaction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request enhances token handling and logging, particularly for TMQ configuration and consumers. The changes correctly propagate tokens from different sources and ensure they are masked in logs. My review includes suggestions to refactor the masking logic in utils.ts for better consistency and to reduce code duplication in the test files by extracting common logic into helper functions. These changes will improve the maintainability of the code.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
==========================================
+ Coverage 80.16% 80.21% +0.05%
==========================================
Files 30 30
Lines 2485 2482 -3
Branches 439 436 -3
==========================================
- Hits 1992 1991 -1
+ Misses 379 378 -1
+ Partials 114 113 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…umer and update test configuration
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request improves token handling and logging. While the changes to maskTmqConfigForLog aim to make logging of sensitive information safer and TmqConfig token handling more consistent, a critical vulnerability was identified: the masking logic for sensitive information is incomplete. Specifically, maskTmqConfigForLog misses the bearer_token field, and SENSITIVE_FIELD_REGEX misses the token field, which could lead to sensitive authentication credentials being logged in plain text. Additionally, an issue was found in the new tests related to inconsistent typing of configuration values, which could lead to incorrect behavior.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
fix: fixed the issue where the data subscription configuration token was not working
Issue(s)
Checklist
Please check the items in the checklist if applicable.