Skip to content

feat(fusillade): dispatch by API key id (DW-1010) - #2156

Merged
tobydigz merged 2 commits into
feat/dw-1009/internal-credentialfrom
feat/dw-1010/fusillade-dispatch-by-key-id
Nov 3, 2026
Merged

tobydigz merged 2 commits into
feat/dw-1009/internal-credentialfrom
feat/dw-1010/fusillade-dispatch-by-key-id

Conversation

@tobydigz

@tobydigz tobydigz commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Queued work authenticated with a key secret stored on every batch and
request template. This is the expand step towards not storing it: requests
now also record the key id, and the daemon dispatches as that id with a
per-attempt internal credential, sent only to this process's own /ai and
valid for the daemon's processing timeout. Rows without an id (queued
before this release) dispatch with their stored key as before.

The secret is still written exactly as before, so the previous release
decodes, claims and dispatches every row this one writes. DW-1012 stops
writing it.

Batches already carry api_key_id. Batchless templates gain one (on the
template, because batch_requests_archive must mirror requests column for
column), set via the new create_flex_as / create_background_as. A claim
reports the id in the request's batch metadata under
API_KEY_ID_METADATA_KEY, which keeps the fusillade public API additive.


Stack created with GitHub Stacks CLI • Give Feedback 💬

View guided diff Turn on auto-fix

@tobydigz
tobydigz added this pull request to stack #2157 November 2, 2026 12:04
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying control-layer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 71eb94f
Status: ✅  Deploy successful!
Preview URL: https://8220165e.control-layer.pages.dev
Branch Preview URL: https://feat-dw-1010-fusillade-dispa.control-layer.pages.dev

View logs

@tobydigz
tobydigz marked this pull request as ready for review November 2, 2026 12:04
@cubic-dev-ai

cubic-dev-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Running ultrareview automatically — this PR appears to change authentication, authorization, or input validation, where a missed bug can expose data or grant the wrong access, so a deeper multi-pass review is worth running. I'll post findings when complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultrareview ran automatically — this PR appears to change authentication, authorization, or input validation, where a missed bug can expose data or grant the wrong access, so a deeper multi-pass review is worth running.

All reported issues were addressed across 16 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread fusillade-arsenal/src/postgres.rs Resolved
Comment thread fusillade-core/src/request/types.rs Resolved
@tobydigz
tobydigz force-pushed the feat/dw-1010/fusillade-dispatch-by-key-id branch from 2edac7a to a8e5be0 Compare November 2, 2026 13:19
Queued work authenticated with a key secret stored on every batch and
request template. This is the expand step towards not storing it: requests
now also record the key id, and the daemon dispatches as that id with a
per-attempt internal credential, sent only to this process's own /ai and
valid for the daemon's processing timeout. Rows without an id (queued
before this release) dispatch with their stored key as before.

The secret is still written exactly as before, so the previous release
decodes, claims and dispatches every row this one writes. DW-1012 stops
writing it.

Batches already carry api_key_id. Batchless templates gain one (on the
template, because batch_requests_archive must mirror requests column for
column), set via the new create_flex_as / create_background_as. A claim
reports the id in the request's batch metadata under
API_KEY_ID_METADATA_KEY, which keeps the fusillade public API additive.
@tobydigz
tobydigz force-pushed the feat/dw-1010/fusillade-dispatch-by-key-id branch from a8e5be0 to 3032cb1 Compare November 2, 2026 15:44
With `api_key_id` among the forwarded batch metadata fields, caller-supplied
batch or template metadata filled that entry, and for a row without a key id
in the database the dispatch processor minted a credential for whatever key
the caller named. A claim now drops any existing entry and fills it from the
database only, and the configured field list never fills it.

The end-to-end test now plants a decoy as each key's stored secret, so it
fails unless dispatch authenticates by key id; the header name in the docs
is corrected.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Turn on auto-fix | Re-trigger cubic

@tobydigz
tobydigz added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 1284778 Nov 3, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants