Repository navigation
Conversation
Replace SQL, bound arguments and variable maps in query diagnostics with operation and count metadata. Use query indices in validation failures instead of rendered SQL. Exercise real SQLite query, exec, create-account and credential-rotation paths with captured secrets. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
Connector PR Review: Omit sensitive SQL values from query diagnosticsBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryThis PR stops The repo-local criteria were applied. Section A (log levels): no levels changed, and the existing The new tests run against real SQLite paths. They check the encoded log output and the recursively decoded JSON values, and they also confirm that arguments still reach the database. The diff gives the following residual risks, all of which the PR and README call out as out of scope:
Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. Reviewed commit: |
There was a problem hiding this comment.
No blocking issues found — see the full review report
Summary
Remove SQL text, bound argument values, and variable maps from application-owned query diagnostics. These fields can contain account-creation and password-rotation credentials, including when SQL uses bind parameters or hashes the password inside the database.
Keep operation, query index, argument count, affected-row count, and transaction metadata. Validation failures identify the query by index instead of returning rendered SQL. Query construction, arguments sent to the database, returned credentials, and idempotency error identity remain unchanged.
Regression proof
TestQueryLoggingDoesNotExposeValuesexercises eleven real SQLite-backed paths: ordinary and grant execution, validation, no-rows validation, DDL idempotency, principal-exists checks, row-query success/failure, inline SQL values, and grant replacement.TestAccountCredentialsStayOutOfQueryLogsinvokes actual account creation and rotation, verifies the returned generated password equals the value stored by the fixture database, and verifies it is absent from captured logs. Assertions inspect both encoded output and recursively decoded JSON fields, including quote-containing values.The identical tests fail against the original
query.gousing Go's file overlay and pass with the fix. Tests also assert that arguments still reach SQL execution unchanged; this is not only a logger-helper test.Scope and limits
This removes explicit application-owned SQL/argument/variable payloads. Database-driver errors remain propagated and can contain statement details; this PR does not claim comprehensive downstream error sanitization or an audit of every row/expression diagnostic. The README states that residual risk.
No dependencies, public configuration schema, provisioning API, or database behavior change. Fixture proof uses in-process SQLite, not a live vendor or deployed connector. Native DB2-tagged builds and external database workflows were not exercised.
Checks
make test,make build, andmake lint: passed; lint reported zero issues.