Skip to content

fix: stop logging YouTube API keys#133

Open
salvageop wants to merge 1 commit into
masterfrom
fix/youtube-api-key-logging
Open

fix: stop logging YouTube API keys#133
salvageop wants to merge 1 commit into
masterfrom
fix/youtube-api-key-logging

Conversation

@salvageop

Copy link
Copy Markdown
Collaborator

What

YoutubeApi.next_api_key/0 logged the raw API key at debug level on every fast-indexing API call:

Logger.debug("Using YouTube API key: #{}") # raw key

Why it matters

  • Production defaults to LOG_LEVEL=debug (config/runtime.exs), so this isn't just a dev-mode leak
  • Logs are persisted to disk and downloadable from the settings UI ("Download logs")
  • Users routinely attach those log dumps to GitHub issues — leaking their API keys publicly

Fix

Log the key's rotation position (Using YouTube API key #1 of 2) instead of the key itself — keeps the round-robin behavior observable without the secret. Added a regression test that captures debug logs and refutes the key appears (fails against the previous code).

Testing

  • tooling/lint_test.sh green

Fast indexing logged the raw API key at debug level on every YouTube API
call. Production defaults to LOG_LEVEL=debug and the log file is
downloadable from the settings UI (and commonly pasted into bug reports),
so keys leaked into persistent, shareable artifacts. Log the key's
rotation position instead.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🐳 Image for commit d29b2c5 published: ghcr.io/communitymaintained/pinchflat-dev:pr-133-d29b2c5

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.

1 participant