Skip to content

Remove unsafeLogUnredactedQueries for now#580

Merged
peter-leonov-ch merged 7 commits intomainfrom
postpone_unsafe_query
Mar 2, 2026
Merged

Remove unsafeLogUnredactedQueries for now#580
peter-leonov-ch merged 7 commits intomainfrom
postpone_unsafe_query

Conversation

@peter-leonov-ch
Copy link
Collaborator

@peter-leonov-ch peter-leonov-ch commented Feb 26, 2026

Summary

  • remove the unsafeLogUnredactedQueries toggle from the code
  • do not log nor queries neither the search params by default
  • remove params logging on HTTP errors

Copilot AI review requested due to automatic review settings February 26, 2026 12:42
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the unsafeLogUnredactedQueries configuration option across the common + Node clients so query text is no longer emitted in logs, and URL query search params are always redacted when logging request context.

Changes:

  • Removed unsafeLogUnredactedQueries from public config/types and connection params wiring.
  • Stopped including raw query in structured log args (client + node connection lifecycle logs).
  • Always deletes query from URL/search params before logging (debug/error contexts), and deletes now-obsolete tests/docs.

Reviewed changes

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

Show a summary per file
File Description
packages/client-node/src/connection/node_base_connection.ts Removes query text from logs and always redacts query from logged URL/search params.
packages/client-node/tests/utils/http_stubs.ts Removes the deprecated config field from test connection params.
packages/client-node/tests/unit/node_client.test.ts Removes the deprecated config field from unit test client config.
packages/client-node/tests/integration/node_logger_support.test.ts Removes tests that exercised the unsafe toggle.
packages/client-common/src/connection.ts Removes unsafeLogUnredactedQueries from the ConnectionParams interface.
packages/client-common/src/config.ts Removes the public config option and stops mapping it into connection params.
packages/client-common/src/client.ts Stops including query text in structured logs at the client layer.
packages/client-common/tests/utils/client.ts Removes test-only config that depended on the unsafe toggle.
packages/client-common/tests/unit/config.test.ts Updates expected connection params object to no longer include the removed field.
CHANGELOG.md Removes documentation mentioning the unsafe logging toggle.

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

@peter-leonov-ch peter-leonov-ch force-pushed the postpone_unsafe_query branch 2 times, most recently from 8912cf7 to 3e0cfdd Compare February 26, 2026 12:57
@peter-leonov-ch peter-leonov-ch force-pushed the postpone_unsafe_query branch 2 times, most recently from 6b35c38 to 46ef34a Compare February 26, 2026 15:11
@peter-leonov-ch
Copy link
Collaborator Author

@copilot review risks this PR can introduce.

Copy link
Contributor

Copilot AI commented Feb 26, 2026

@peter-leonov-ch I've opened a new pull request, #583, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

polish the test
@peter-leonov-ch
Copy link
Collaborator Author

Addressed risk analysis from:

}),
).rejects.toThrow() // We expect this to fail since the query is invalid, but we want to check the logs
for (const entry of logs) {
expect(entry.message).not.toContain(secret)
Copy link
Member

Choose a reason for hiding this comment

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

do we need to add an explicit test for query itself?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fair point, added.

@peter-leonov-ch peter-leonov-ch merged commit 535e9b7 into main Mar 2, 2026
49 checks passed
@peter-leonov-ch peter-leonov-ch deleted the postpone_unsafe_query branch March 2, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants