feat(settings): cell URL + generated cellToken for server investigations - #136
Merged
Conversation
The UI transport had nowhere to reach: config/proxies.yml was empty and getCellBaseUrl() returned ''. Declare the cell domain and point the transport at it. - config/proxies.yml: the cell host (EIP-derived sslip.io behind Caddy TLS), path allowlist /investigations, and header inject Authorization: 'Bearer ' + kv.cellToken — the iframe can't set the header itself, so the platform proxy injects it from encrypted KV. - config/proxies.expected.yml + swap --require-empty-proxies → --proxies-manifest (framework #22 tooling): the release now pins the exact reviewed manifest instead of requiring it empty. Verified: npm run package && inspect:pack passes against the pinned manifest. - getCellBaseUrl() defaults to the proxies.yml domain, overridable by a cellUrl app setting (hydrated in DatasetProvider) so a cell redeploy under a new host needs a settings change, not a rebuild — but it must match proxies.yml or the proxy blocks it. Requires the cellToken encrypted-KV secret (= the cell's UI_BEARER) to be created by an admin — a one-time deploy step. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The server-investigator cell authenticates every request against a shared bearer: the app-scoped KV key `cellToken` (injected by proxies.yml as `kv.cellToken`) must equal the cell's `UI_BEARER` secret. Rather than ask the operator to hand-generate and paste a token on both sides, the Settings "Server-side investigations" card now: - Generates a 32-byte random hex token in the browser (openssl-rand-hex-32 shape), stores it raw in KV under `cellToken`, and displays it read-only for copy into the cell's UI_BEARER. - Lets the operator set the cell base URL (persisted to AppSettings `cellUrl`, pushed into the transport via setCellBaseUrl). Must match the domain in config/proxies.yml. Also corrects the toggle sub-text: the cell no longer self-gates on the flag (removed in the cell #133 change), so "the cell re-checks this flag on every trigger" was stale. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158jez4WfWj6ttmaxh3HEbT
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.
Summary
Adds a Cell URL field and a generated cell token to the Settings "Server-side investigations" card, so an operator can wire the app to the server-side investigator cell without hand-editing KV or pasting secrets on both sides by memory.
The cell authenticates every request against a shared bearer: the app-scoped KV key
cellToken(injected byproxies.ymlaskv.cellToken) must equal the cell'sUI_BEARERsecret. This PR generates that token in the browser and shows it for copy into the cell.What changed
openssl rand -hex 32shape) viacrypto.getRandomValues, stores it raw in the app KV store undercellToken(so the proxy injects it verbatim), and displays it read-only for copy into the cell'sUI_BEARER.AppSettings.cellUrland pushes into the transport viasetCellBaseUrl. Must match the domain declared inconfig/proxies.yml, or the platform proxy blocks the fetch.0.13.28 → 0.13.29so the pack actually installs on staging.Validate on staging
Deployed as
apm-0.13.29.tgz.cellTokenon mount).Cell side (separate infra VM)
Set the same value as the cell's
UI_BEARERsecret and restart the cell:App KV
cellTokenmust match cell SSM/apm-cell/UI_BEARERexactly, or the cell rejects every proxied request as unauthorized.Known limitations
🤖 Generated with Claude Code