Skip to content

[Superseded by #97] Add stateless backend-scoped task handles - #84

Merged
lucarlig merged 0 commit into
user/luca/stabilize-gateway-test-portsfrom
user/luca/issue-6185-task-handles
Aug 18, 2026
Merged

[Superseded by #97] Add stateless backend-scoped task handles#84
lucarlig merged 0 commit into
user/luca/stabilize-gateway-test-portsfrom
user/luca/issue-6185-task-handles

Conversation

@lucarlig

@lucarlig lucarlig commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the versioned cfth1 stateless task-handle codec for modern MCP Tasks
  • protect upstream task routes with misuse-resistant AES-256-GCM-SIV and replica-safe random nonces
  • bind handles to the trusted authorization-context ID, virtual host, configuration revision, immutable backend ID, and backend generation
  • require current effective-configuration validation on decode and return indistinguishable invalid-task errors without exposing upstream IDs
  • document that this codec is an architecture prerequisite; task creation and lifecycle proxy handlers remain follow-up work
  • update h2 to patched 0.4.16 after the fresh CI advisory database flagged 0.4.15

Why this is needed

Modern MCP Tasks return identifiers that clients reuse later with tasks/get, tasks/update, and tasks/cancel. Those identifiers are backend-specific and may behave like bearer tokens. Returning them directly would expose upstream details and would not safely preserve which backend owns a task.

The future dataplane is horizontally scaled and stateless. A process-local task map would require session affinity, while a Redis task map would add hot-path state, expiry, and cleanup. An encrypted routing handle carries the minimum routing context and can be decoded by any replica sharing the key.

Binding the handle to the trusted authorization context, virtual host, configuration revision, backend ID, and backend generation prevents cross-tenant or cross-policy replay and fails closed after backend removal or reassignment. It also keeps authorization current: every lifecycle request must still validate the JWT, load effective configuration, enforce scope/RBAC policy, and verify the backend generation before making an upstream call.

This PR provides that security and routing primitive only. It does not expose Tasks methods or make the codec current handler behavior; those handlers remain follow-up work.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo nextest run --locked --workspace — 231 passed
  • cargo deny fetch && cargo deny check advisories licenses
  • cargo build --locked --workspace
  • cargo shear --check-test-targets --deny-warnings --locked
  • mdbook build _context/wiki
  • mdbook test _context/wiki

Closes IBM/mcp-context-forge#6185

@lucarlig
lucarlig force-pushed the user/luca/issue-6185-task-handles branch from 232aac3 to 80d8ada Compare August 11, 2026 11:01
@lucarlig
lucarlig marked this pull request as ready for review August 11, 2026 13:25
@lucarlig
lucarlig changed the base branch from main to user/luca/stabilize-gateway-test-ports August 18, 2026 08:46
@lucarlig lucarlig closed this Aug 18, 2026
@lucarlig
lucarlig force-pushed the user/luca/issue-6185-task-handles branch from fe0a5e0 to 50b0dab Compare August 18, 2026 08:56
@lucarlig
lucarlig merged commit 50b0dab into user/luca/stabilize-gateway-test-ports Aug 18, 2026
@lucarlig
lucarlig force-pushed the user/luca/stabilize-gateway-test-ports branch from de44c04 to 70605f4 Compare August 18, 2026 08:56
@lucarlig lucarlig changed the title Add stateless backend-scoped task handles [Superseded by #97] Add stateless backend-scoped task handles Aug 18, 2026
@lucarlig

Copy link
Copy Markdown
Contributor Author

Stack migration note: GitHub recorded this PR as merged into user/luca/stabilize-gateway-test-ports, not into main, while the branch ancestry was being corrected. The task-handle review continues in #97, with #95 above it in native GitHub stack #98.

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.

[FEATURE][CF-DATAPLANE][TASKS]: Add stateless backend-scoped task handles

2 participants