Skip to content

fix(controlplane): avoid re-logging caller-supplied seed API key - #3170

Open
davideugui1 wants to merge 1 commit into
wundergraph:mainfrom
davideugui1:fix/seed-avoid-logging-supplied-api-key
Open

fix(controlplane): avoid re-logging caller-supplied seed API key#3170
davideugui1 wants to merge 1 commit into
wundergraph:mainfrom
davideugui1:fix/seed-avoid-logging-supplied-api-key

Conversation

@davideugui1

@davideugui1 davideugui1 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

The seed script's console.log(API Key: ${apiKey}) unconditionally re-echoes the API key even when the caller supplied it themselves via API_KEY. The only shipped invocation paths (npm script, docker-compose.full.yml, Helm organization-seed Job) all do this, so the log line was pure avoidable disclosure in every documented setup.

Now the key is only logged when it was auto-generated by ApiKeyGenerator (API_KEY unset), which is the one case where this log is the operator's sole way of learning it.

Fixes #3169

Prior to this change, the seed script unconditionally logged the organization API key to stdout via a bare console.log, bypassing the pino logger used elsewhere in the script. Every shipped invocation path always supplies API_KEY explicitly, so in practice this line only ever re-echoed a secret the caller already had. This change only logs the key when it was auto-generated by ApiKeyGenerator (i.e. API_KEY was not set).
@davideugui1
davideugui1 requested a review from a team as a code owner August 19, 2026 12:01

@claude claude 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4df69319-ccf4-40d7-b829-d23fbdac6011

📥 Commits

Reviewing files that changed from the base of the PR and between 9ddb729 and 2a6c168.

📒 Files selected for processing (2)
  • controlplane/src/bin/get-config.ts
  • controlplane/src/bin/seed.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

Changes

API key logging

Layer / File(s) Summary
Track and conditionally log API keys
controlplane/src/bin/get-config.ts, controlplane/src/bin/seed.ts
getConfig reports whether it generated an API key. The seed script prints generated keys and does not expose environment-provided key values.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 2a6c1

This localized change stops caller-supplied API keys from being re-logged while preserving logging for generated keys; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: preventing the seed script from logging caller-supplied API keys.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

seed script logs the organization API key even when the caller already supplied it

1 participant