Repository navigation
fix(api): require INGESTION_API_KEY on the app image before any team exists - #3760
Conversation
With ENABLE_INGESTION_API_KEY set and no team yet, the preset key made the otlp/hyperdx receiver attach, but authentication followed teams[0], which is absent, so the receiver accepted unauthenticated data.
🦋 Changeset detectedLatest commit: ec5a83e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@andrewdunndev is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
PR Review
2 finding(s): 🔴 0 P0/P1 · 🟡 2 P2 · 🔵 0 P3 None could be anchored to changed lines; they are listed below. Findings outside the changed lines
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a tight, well-scoped security fix: the no-team + 🟡 P2 — recommendedNone. 🔵 P3 nitpicks (1)
Reviewers (7): correctness, security, testing, maintainability, adversarial, previous-comments, project-standards. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
…o-team key case Also drop the INGESTION_API_KEY check from the no-team fallback: with no key, apiKeys stays empty and no auth is attached either way.
Summary
Follow-up to #3633, which merged before this fix reached its branch.
With
ENABLE_INGESTION_API_KEY=trueand no team created yet, the preset key is the only key, so theotlp/hyperdxreceiver is attached. Authentication followsteams[0]?.collectorAuthenticationEnforced, though, and that isundefinedwhen there is no team. The receiver then accepts data without authentication. Before #3633, the app image opened no receiver in that state.The deep review on #3633 raised this.
How to reproduce
Starting point: the app image with the standalone collector in OpAMP supervisor mode, a fresh database with no team, and
INGESTION_API_KEY=preset-keyandENABLE_INGESTION_API_KEY=trueon the API.main: the OpAMP config attachesotlp/hyperdxwith noauthand nobearertokenauth/hyperdxextension.bearertokenauth/hyperdxauthenticator with the preset key's variants. The new test inopampController.test.tscovers this case.How to test on Vercel preview
N/A, non-UI change.
References