Repository navigation
fix(orchestrator): reject empty broker secrets, bound file uploads, and remove client casts - #1851
Merged
Merged
Conversation
…nd remove client casts
The upload stream stopped only at the 512 MiB ceiling, so a request that declared one byte still sent 512 MiB to the coordinator before the host rejected it. The stream now stops at the declared size. A Content-Length above the ceiling is also rejected before the RPC starts, even when x-upload-size is small. The guest writes to a temporary file and removes it when the upload fails, so a stopped upload leaves no partial file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The warning ran only when NODE_ENV is "production". No shipped deployment sets NODE_ENV (the Helm chart, the orchestrator image, and Tilt do not), so the warning never ran. The Helm chart also cannot set a dedicated broker bearer: it gives the coordinator's ENGRAM_CONNECTION_BROKER_BEARER the CONTROL_PLANE_BEARER key. A warning that fires there would tell operators to do what the chart cannot do. The test now covers the fallback itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Hardens
orchestrator/security boundaries and removes duplicated auth/client boilerplate:bearerMatches()(orchestrator/src/routes/connection-credential-broker.ts) rejects an emptyexpectedsecret.CONNECTION_BROKER_BEARERstill falls back toCONTROL_PLANE_BEARERwhen unset: the Helm chart gives the coordinator'sENGRAM_CONNECTION_BROKER_BEARERtheCONTROL_PLANE_BEARERkey, so a fail-closed default would stop the broker in every chart deployment.orchestrator/src/routes/session-files.tsstops the stream at the declared size (x-upload-size, elseContent-Length), cancels the reader, and returns413 Payload Too Large. AContent-Lengthabove 512 MiB is rejected before the RPC starts. The guest writes to a temporary file and removes it on failure, so a stopped upload leaves no partial file.requireAdmin(admin, integration-op, integration-oauth, oidc-key-admin) intoroutes/guard.tsand theGetSessiontype intoauth/types.ts. The 401/403 semantics are unchanged;admin-guard.test.tschecks each route.as unknown as <Client>double casts acrossrpc/androutes/. The default Connect clients (createClient(...)incontrol-plane/client.ts) are now assigned directly to the existing narrow client interfaces, so the compiler checks each interface against the generated client.Validation
bun run typecheck: passed.bun testsuites (session files, broker, broker config, admin guard): passed.git diff --check: passed.🤖 Generated with Claude Code