Skip to content

fix(host): allow concurrent authenticated Broker sessions per identity - #80

Merged
MichalCz merged 5 commits into
mainfrom
fix/79-concurrent-broker-sessions
Sep 29, 2026
Merged

MichalCz merged 5 commits into
mainfrom
fix/79-concurrent-broker-sessions

Conversation

@MichalCz

@MichalCz MichalCz commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

What this changes

Allow independent, simultaneous authenticated Broker HTTP/2 sessions to share one logical Broker ID without an arbitrary session or certificate-count cap. Each connection must present a TLS-verified client certificate and independently pass registration authorization; the Broker role and normalized registration must match. Different trusted certificates may coexist under that ID, including across certificate rotation. Guest, local-peer, and federation uniqueness remains unchanged.

Each Broker session receives its own route updates and owns its HTTP/WebSocket requests. Closing one admitted Broker control stream tears down only its physical session; a failed duplicate registration cannot detach an admitted one. A cancelled Broker WebSocket open no longer forwards after asynchronous authorization or falls back to another route. No wire-protocol changes.

Closes #79.

Verification

  • npm test: bounded partition 1, 387/387 passed; partition 2, 173 passed, 4 skipped; zero failures with the existing 1 MiB per-test memory guard.
  • npm run lint and git diff --check: passed.
  • Real-mTLS tests cover independently authorized sessions with distinct trusted certificate fingerprints, valid registration mismatch, concurrent identical request IDs, route updates, cancellation, control-stream teardown, and sibling survival.
  • MemLab three-snapshot analysis of first-use mTLS test growth found no retained JavaScript heap leak; a representative pre-test warmup resolved the bounded guard failure without changing the guard.

Evidence limit

Cancellation after a destination is acquired has an explicit cleanup guard in the Host, but there is no separate deterministic acquisition-race test. The test exercises cancellation during deferred route authorization and verifies no fallback and sibling usability. Raw changed-line coverage was not measured.

Guard asynchronous registration and request forwarding against identity races, disconnects, and Host shutdown. Add regression coverage for spoofing, concurrency, and cancellation.
Track remote Broker sessions separately under one logical ID, bind request ingress and route frames to each session, and exercise concurrent mTLS behavior. Interim checkpoint before expanding certificate policy and cancellation lifecycle per review.
…sions

Allow separately authenticated Broker certificates for one ID, reject valid registration differences, prevent cancelled VWS opens from forwarding, and tear down only the session whose admitted control stream closes. Update docs and bounded regressions.
Record Phase 2b validation, review outcome, focused commit SHA, and protected-main manual merge requirement.
Record rebased phase commits, the new main base, and post-rebase validation without changing Broker behavior.
@MichalCz
MichalCz force-pushed the fix/79-concurrent-broker-sessions branch from 6ea4ab0 to 4818abb Compare September 29, 2026 09:54
@MichalCz
MichalCz merged commit c42810a into main Sep 29, 2026
13 checks passed
@MichalCz
MichalCz deleted the fix/79-concurrent-broker-sessions branch September 29, 2026 09:57
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.

Allow concurrent authenticated broker sessions for one peer identity

1 participant