feat: accept Honeycomb Management API key in integration connect - #56
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vem7UpKJAXmFwtXrqkwreh
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vem7UpKJAXmFwtXrqkwreh
An API build that predates the management-key fields strips them from the connect body and stores the integration without them, silently discarding the user's key. The connect response echoes the stored metadata (the key ID survives redaction), so the CLI now verifies managementApiKeyId is present after a Honeycomb connect and exits non-zero with a disconnect-and-retry hint when it is not. Also from the same review round: the two management-key wizard steps share one step factory, and both key halves are trimmed on the flag path as well as the interactive path (whitespace-only values now count as missing). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vem7UpKJAXmFwtXrqkwreh
boristane
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by boris · Slack thread
The Honeycomb connect flow now also takes a Management API key (ID + secret) — required, per boris's follow-up — matching what
POST /v1/integrations/connectaccepts since nominal #1298.Deliberate breaking change:
polylane integration connect --type honeycombpreviously worked with just--regionand--api-key; it now refuses to run without the Management API key pair. Requested by boris.Before
polylane integration connect --type honeycombasked for the region and the configuration API key, and there was no way to pass a Management API key at all.After
One smooth sequence, same path for everyone:
New flags for non-interactive use:
--management-api-key-idand--management-api-key-secret. Both are required: a non-interactive connect missing either one fails withMissing required flag: --management-api-key-...(exit code 2) and the hintPass both --management-api-key-id and --management-api-key-secret., same style as the other required credential flags. Both halves are trimmed on the flag path as well as the interactive path; whitespace-only values count as missing.Deploy-skew guard: an API build that predates the management-key fields strips them from the connect body and would silently discard the key. The CLI now verifies the connect response's metadata still carries
managementApiKeyId(it survives redaction on the new API, and is absent when the old API stripped the field). When it is missing, the CLI exits 1 instead of reporting success:How
connectWithCredentials(src/commands/integration/connect.ts), built from a sharedmanagementKeyStepfactory (flag short-circuit, non-interactive usage error, prompt) using the existingrunSteps/SKIPPED/BACK machinery so back-navigation works across all four steps.honeycombManagementKeyFields()trims both halves, puts the pair into the request body, and throws a usage error naming the missing flag if either half is empty, as a backstop behind the prompts.assertHoneycombManagementKeyStored()runs after every honeycomb connect and throws the deploy-skew error above when the response metadata lacks the key ID.managementApiKeyId/managementApiKeySecretonly when the matching nominal deploy lands. The spread keeps typecheck green on both sides of that deploy; the current API's non-strict body schema strips the unknown keys (now caught post-connect), the new one validates them (a bad key 400s with the server's actionable message). Reading the key ID back uses the same trust-boundary pattern (structural cast), since the generated metadata type lags the same way.Verify
npm run typecheck(includes codegen against the live spec) — cleannpm run lint— cleannpm run test— 299 pass, 0 fail (test/integration-connect-honeycomb.test.ts: field pairing + trimming + whitespace-only rejection; drop-detection passes with a stored key ID, throws with the exact message/hint when the field is missing, empty, or metadata is null, and includes the console link when the response carries one)npm run build— dist/polylane.mjs buildsGenerated by Claude Code