fix(controlplane): avoid re-logging caller-supplied seed API key - #3170
fix(controlplane): avoid re-logging caller-supplied seed API key#3170davideugui1 wants to merge 1 commit into
Conversation
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).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughChangesAPI key logging
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to 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)
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. Comment |
Description
The seed script's
console.log(API Key: ${apiKey})unconditionally re-echoes the API key even when the caller supplied it themselves viaAPI_KEY. The only shipped invocation paths (npmscript,docker-compose.full.yml, Helmorganization-seedJob) 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_KEYunset), which is the one case where this log is the operator's sole way of learning it.Fixes #3169