Repository navigation
feat(api): add ENABLE_INGESTION_API_KEY to honor INGESTION_API_KEY on the app image - #3633
andrewdunndev wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 6f63812 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✅ No issues found. |
Deep Review✅ No critical issues found. The change is a clean, default-off opt-in ( 🟡 P2 — recommended
🔵 P3 nitpicks (1)
Reviewers (6): correctness, security, testing, maintainability, kieran-typescript, 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 |
Summary
On the app image, the OpAMP config ignores
INGESTION_API_KEY, so an external collector has to authenticate with the team's generated key. That key changes whenever the team is recreated, for example after the database is rebuilt, and the collector is locked out until someone copies the new key from Team Settings into its config.This adds an opt-in
ENABLE_INGESTION_API_KEY=true, in the same style asENABLE_DATADOG_RECEIVER. With it set,INGESTION_API_KEYis accepted alongside the team key, so a deployment can pin a key that survives a rebuild. Nothing changes when it is unset. I kept the existing all-in-one and dev gate as it is, since its security reasoning isn't written down anywhere. Happy to rename the variable, or to drop the gate instead if you'd prefer that.How to reproduce
Starting point: the app image (
HYPERDX_IMAGE=hyperdx,NODE_ENV=production) with the standalone collector in OpAMP supervisor mode, and collector authentication enforced for the team (the default for a new team).yarn devdoes not show the problem, becauseIS_DEValready honors the key. The new unit tests inopampController.test.tscover the same three cases.On
main:INGESTION_API_KEY=preset-keyon the API and restart it.Authorization: preset-key: it is rejected, andpreset-keyis missing from thebearertokenauth/hyperdxtokens in the OpAMP config.On this branch:
INGESTION_API_KEY=preset-keyandENABLE_INGESTION_API_KEY=trueand restart the API.main.How to test on Vercel preview
N/A, non-UI change.
References