Skip to content

fix(service-automation): sign the http node's inline request with the one scheme, and refuse a secret that did not resolve - #20640

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-20628-http-node-signs
Sep 29, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-20628-http-node-signs

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #20628
Clause-②: yes (widening). @objectstack/core gains the exported scheme ⇒ at least minor for core.

What changed

A flow http node's signingSecret is declared as "HMAC-SHA256 secret → X-Objectstack-Signature", and no arm is named. Only the durable outbox arm signed. The inline arm, and the durable arm's fallback when no messaging HTTP outbox is wired, sent no signature header, and the run still reported success. After this PR the key means one thing on every arm.

  • One scheme, moved to @objectstack/core (the seat's ruling on the claim). Two new exports on the @objectstack/core root come from packages/core/src/security/http-signature.ts through packages/core/src/security/index.ts:
    • signHttpBody(body: string, secret: string): string returns sha256= plus the lowercase hex HMAC-SHA256 of the exact body bytes.
    • HTTP_SIGNATURE_HEADER is 'X-Objectstack-Signature'.
    • @objectstack/runtime re-exports the core root with export *, so both names appear there too.
  • @objectstack/service-messaging keeps its published names, signHttpBody and HTTP_SIGNATURE_HEADER. They are now re-exports of the core bindings. http-sender.ts re-exports them under the module-internal names the two outboxes import (signBody / SIGNATURE_HEADER). No second implementation remains, and nothing it publishes is removed or renamed. A test pins messaging.signHttpBody === core.signHttpBody against the built packages.
  • http-nodes.ts, the inline arm (also the no-outbox fallback) sends X-Objectstack-Signature whenever signingSecret is set. The value is signHttpBody over the exact string it passes as fetch's body, or over the empty string when there is no body.
  • The refusal: a non-empty authored signingSecret that resolves to no value in the run fails the node before either arm, so nothing is sent or enqueued. The full condition is below.

Which bytes each arm signs

  • Outbox arm (unchanged). MemoryHttpOutbox.enqueue and SqlHttpOutbox.enqueue sign deliveryBody(payload) at enqueue, and sendOnce posts deliveryBody(payload). The node passes payload: body ?? {}:
    • an object body is sent as its JSON.stringify;
    • a string body is sent verbatim;
    • no body is sent as {}.
  • Inline arm and the no-outbox fallback. These use the node's own serialization:
    • a non-null body is sent as JSON.stringify(body), so a string body goes out JSON-quoted;
    • otherwise no body is sent, and the signature is over the empty string.
  • The two serializations differ for a string body and for no body. Each arm signs what it sends. On every arm the pins check at a real local receiver that the received header equals signHttpBody(receivedBytes, secret).
  • The empty-body HMAC is pinned as a literal in both the core test and the node test (sha256=28c9179f…bd5187f7 under the test secret). So the fallback can't drift to signing {} or null while it sends nothing.

The refusal condition, from the measurement

What signingSecret becomes after interpolate(...) and the contract parse. The "after" column was measured in a scratch run at the fixed head. The two refused rows were also measured on main.

authored signingSecret resolves to on main after
absent absent no header no header
'' '' no header no header: the unsigned-on-purpose spelling (the cleared form PR #20615 defines), on every arm
a literal the literal inline: no header; outbox: signed signed on every arm
a whole {token} with no value in the run undefined (the parse accepts it) sent with no header, success: true refused
a {token} whose value is '', or several tokens that all render empty '' sent with no header, success: true refused
a {token} whose value is null or a number a non-string refused by the contract parse, naming config.signingSecret unchanged
k_{token} with no value 'k_' inline: no header signed with k_. The receiver's check then fails, so the error is loud there. The executor can't tell this apart from a real literal.
  • The rule: refuse when the authored value is a non-empty string and the resolved value is undefined or ''.
  • The refusal is refuseNode, a guard refusal. That is the same class as this file's url refusal and the Flow node filters silently blank date macros: the template engine consumes {…} before the query engine sees it #3810 collapsed-filter precedent, so a fault edge does not route it. A new row in guard-refusal-inventory.test.ts pins this.
  • It runs before the durable branch. So the outbox arm also refuses, where before it enqueued the delivery unsigned.
  • The message names the key and the unsigned-on-purpose spelling, and it carries no tracker number.

Evidence (final head 62f989f1c)

  • Measured before the fix, RED. Commit b9a7d9115 adds only the pins, on the unfixed executor at 542670da6.
    • http-node-signing.test.ts: 19 failed, 8 passed. Every signing pin failed on all three in-process arms: inline; durable with no messaging service; durable with a MessagingService and no outbox.
    • The failures read AssertionError: no X-Objectstack-Signature arrived: expected undefined to be type of 'string'. The GET pin read expected undefined to be 'sha256=28c9179fd9763c0e7d41dc5241d9d7…'.
    • Both refusal pins read expected true to be false on each arm and on the outbox arm. The run succeeded and the request left unsigned.
    • The 8 greens were the controls: no key and '' on the three arms, plus the outbox arm's signature and its ''.
    • guard-refusal-inventory.test.ts: the new row failed (1 failed, 15 passed), because the fault edge routed the failure.
  • After the change. The same two files, plus http-nodes.test.ts and http-delivery-outcome.integration.test.ts: 4 files, 56 passed.
  • Ablation. The fix was committed first, and the restore had its own trap.
    • scripts/ablation-replace.mjs replaced the inline arm's signing expression with ? headers: anchor 1 → 0, blob 2137f1ab2056 → 061481dd31ee.
    • http-node-signing.test.ts then gave 12 failed, 16 passed: exactly the 4 signing pins × 3 in-process arms. The quoted failures were no X-Objectstack-Signature arrived: expected undefined to be type of 'string' and expected undefined to be 'sha256=28c9179fd9763c0e7d41dc5241d9d7…'.
    • Restore: blob 2137f1ab2056 equals HEAD, and git diff HEAD is empty. The trap proved it a second time.
    • The ablation ran at 14828798f. git diff --stat 14828798f 62f989f1c on http-nodes.ts and the test file prints nothing.
    • There is no build leg: the subject is service-automation's own src/, which vitest reads directly.
  • Package suites at 62f989f1c, after merging origin/main at 3f45b6cc1:
    • @objectstack/service-automation: 153 files, 1895 tests passed.
    • @objectstack/service-messaging: 46 files, 507 passed.
    • @objectstack/core --project local: 57 files, 1525 passed. http-signature.test.ts alone: 3 passed.
    • typecheck on the three packages: exit 0. Both test layers compile, with no new debt.
  • Whole tree. pnpm build --concurrency=2 at 62f989f1c: 72 of 72 tasks succeeded. That includes every package downstream of @objectstack/core (the ...@objectstack/core consumer direction). So the two new root names collide with no export * consumer (@objectstack/runtime, @objectstack/plugin-hono-server).
  • Gates at 62f989f1c.
    • dispatch-gates --commands derived 65 families. All 65 ran, and every exit code was captured before any pipe: 65 exit 0. --ran reconciles to "65 run, 0 NOT-MEASURED (a DERIVED zero)".
    • The ⛔ artifact rosters under paths in this diff: 4 run, 4 exit 0 (check-changeset-fixed, check:authz-resolver, check:error-code-casing, check:filter-alias-parity). Also run: check:published-readme-exports, exit 0.
    • pnpm lint (repo-wide eslint, --no-inline-config): exit 0.
  • Not measured locally; CI runs these:
    • the 5 path-scheduled CI jobs (the Test Core shards, Temporal Conformance, the Dogfood shards);
    • the 11 wide-population families;
    • the 6 families whose argv carries a workflow-only value.

Acceptance notes

  • Durable GET never delivers. This is outside this card, a different defect, so it is not fixed here. It is recorded for the seat.
    • A durable: true node with method: 'GET' enqueues payload: {}. The dispatcher's send then refuses a GET that has a body, with Request with GET/HEAD method cannot have body..
    • So the row stays pending and retrying, and it never reaches the receiver. The run meanwhile reports success.
    • Measured at the executor seam with a real MessagingService, MemoryHttpOutbox and HttpDispatcher and a local receiver. After one tick the row showed status: pending, attempts: 1, that error, and the receiver had nothing.
    • No public door was measured and no real producer is named, so it is not filed.
    • A side effect: the outbox arm would sign a bodyless GET over {}, not the empty body. That is moot while such a request cannot be sent.
  • flow-credential-projection.ts docblock. It says the durable arm hands signingSecret to the outbox, "which signs every delivery". That is still true, but now incomplete, because the inline arm signs too. It is not edited here: the file is outside this card's file surface.
  • File surface. guard-refusal-inventory.test.ts sits outside builtin/. I read "http-nodes.ts and its tests" as including the inventory row that drives the http executor. The inventory's own header asks that each new guard be added there.
  • Header case. The inline arm mirrors the outbox: author headers first, then the signature under the exact name X-Objectstack-Signature. That overrides an author header with the same casing. A differently-cased author header would travel beside it, on both arms alike. Noted only.
  • Behaviour change to call out: a durable node whose authored secret does not resolve now refuses. Before, it enqueued an unsigned delivery.

Cross-lane

packages/core belongs to domain:engine. The new exports, exactly: signHttpBody and HTTP_SIGNATURE_HEADER on the @objectstack/core root, which @objectstack/runtime also carries through its export *. No existing core export changed.

Changeset

.changeset/20628-http-node-signs-both-arms.md: @objectstack/core minor, @objectstack/service-automation and @objectstack/service-messaging patch. It carries the Clause-②: yes (widening) line.


Generated by Claude Code

…the unfixed executor)

Measuring pins, committed before the fix. A real local receiver checks
what arrived: with signingSecret set, the inline arm and both durable
no-outbox fallbacks deliver no X-Objectstack-Signature (19 red), a
secret whose template resolves to nothing is sent unsigned instead of
refused, and the guard inventory row routes to the fault handler. The
no-key, empty-string and outbox-wired controls are green.

Claude-Session: https://claude.ai/code/session_01XY5uCwTjZj7884yYtyur4H
Co-authored-by: Claude <noreply@anthropic.com>
…e scheme, and refuse a secret that did not resolve

The outbound HTTP signature scheme (signHttpBody, HTTP_SIGNATURE_HEADER)
moves to @objectstack/core, the runtime floor both senders stand on;
service-messaging re-exports the same bindings under its published
names. The flow http node's inline arm, and the durable arm's no-outbox
fallback that degrades to it, now send X-Objectstack-Signature over the
exact bytes they hand fetch (the empty body when there is none). A
non-empty signingSecret that renders to nothing at run time refuses the
node instead of sending unsigned; an authored '' still sends unsigned on
purpose, on every arm.

Claude-Session: https://claude.ai/code/session_01XY5uCwTjZj7884yYtyur4H
Co-authored-by: Claude <noreply@anthropic.com>
…ation and messaging patch

Claude-Session: https://claude.ai/code/session_01XY5uCwTjZj7884yYtyur4H
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

6 anchor(s) derived from 3 changed package(s); no hand-written page names any of them. ⚠️ 2 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/services/service-messaging/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/services/service-messaging/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 27 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 04b202e5cb8c642d881615f8a276edb5e7ceb1c3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7fe99aef3fbe8b80db85a876f3f63a8efbcb607d — the merge of head 62f989f1c227c94050384a95aa632ae6b6d19bb4 into base 04b202e5cb8c642d881615f8a276edb5e7ceb1c3, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7fe99aef3fbe8b80db85a876f3f63a8efbcb607d && git checkout 7fe99aef3fbe8b80db85a876f3f63a8efbcb607d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 04b202e5cb8c642d881615f8a276edb5e7ceb1c3 62f989f1c227c94050384a95aa632ae6b6d19bb4 && git checkout -B drift-repro 04b202e5cb8c642d881615f8a276edb5e7ceb1c3 && git merge --no-ff 62f989f1c227c94050384a95aa632ae6b6d19bb4

node scripts/docs-audit/affected-docs.mjs --json 04b202e5cb8c642d881615f8a276edb5e7ceb1c3

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Sep 29, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review September 29, 2026 12:59
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 89801cd Sep 29, 2026
43 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-20628-http-node-signs branch September 29, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling

Projects

None yet

2 participants