Skip to content

fix: keep API keys out of DEBUG logs and pin publish-workflow actions - #103

Merged
peterfoldes merged 2 commits into
mainfrom
peter/inf-242-dbapi-log-scrub
Dec 1, 2026
Merged

peterfoldes merged 2 commits into
mainfrom
peter/inf-242-dbapi-log-scrub

Conversation

@peterfoldes

Copy link
Copy Markdown
Contributor

What

  • The websockets library logs every handshake header at DEBUG, so any app running with DEBUG logging wrote the X-API-Key / bearer token in clear text. The driver already had a logger adapter that suppresses this, but only used it for execution-ownership connections; it now wraps every websocket connect and reconnect.
  • Third-party GitHub Actions (including the PyPI publish job, which holds publishing authority) are pinned to the commit SHAs of the tags already in use; no version changes. The internal wherobots/ci-tools@main call is left as-is per org Renovate policy.

Behavior change

websockets' DEBUG frame/ping tracing is no longer emitted on any connection. INFO and above are unchanged.

Tests

New tests drive websockets' real handshake-header logging at DEBUG and assert the key/token never appears, for connect() and connect_direct(), API key and bearer token, ownership on and off. A control test confirms the key leaks without the adapter. pytest: 370 passed; pre-commit clean.

Rollout

  • Logging fix reaches users only after a new release is published to PyPI. Then raise the minimum driver version in harlequin-wherobots and airflow-providers-wherobots.
  • Release notes should say earlier versions log the API key/token at DEBUG and that any key that may have been logged should be revoked.
  • Action pinning takes effect on merge.
  • May conflict with feat: log through per-module loggers under wherobots.db #86 around the logger code.

Refs INF-242
Refs INF-249

websockets traces every handshake header at DEBUG, so any application
running with DEBUG logging wrote the X-API-Key / Authorization bearer
token in clear text. The DEBUG-suppressing transport logger was only
attached for execution-ownership connections; attach it to every
websocket connection (initial connect and reconnects alike).

Refs INF-242
The PyPI publish job holds an OIDC token that can publish the package,
so a retargeted upstream tag would run with publish rights. Pin every
third-party action to the commit its current tag resolves to; the org
Renovate policy keeps these digests updated.

Refs INF-249
@peterfoldes
peterfoldes requested a review from a team as a code owner December 1, 2026 03:34

@salty-hambot salty-hambot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed by Salty Hambot 🤖🧂 at 138c002

No issues found.
💰 $0.0681 · 30.8k in / 1.8k out tokens · ⏱️ 16.9s · us.openai.gpt-6-sol high, prompt coverage-v1
💬 To request a re-review, comment @salty-hambot review

@peterfoldes
peterfoldes merged commit d1b66df into main Dec 1, 2026
7 checks passed
@peterfoldes
peterfoldes deleted the peter/inf-242-dbapi-log-scrub branch December 1, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants