Date: 2026-08-18
Accepted (GH #261)
An SSTP pair carries a mode per direction. SstpModeToRouteMode maps the
inbound one onto SstpInbound.RouteMode, and docs/SSTP.md stated that “a pair
can FORWARD outbound while PUBLISH-ing inbound”.
The router never read it. HandleEvent resolved an SSTP-ingested SET via
GetStreamStateBySID, flagged sstpInbound = true, and then returned
unconditionally:
if sstpInbound {
return nil
}
That guard sat before the RouteModeImport check and before the aud /
explicit-route fan-out, so every SET entering goSignals over SSTP was treated as
IMPORT regardless of the mode configured on the pair. Both ingest paths reach
it: the responder side (runner_sstp_server.go) and the initiator’s
response-SET side (sstp_outbound.go).
The comment cited PRD #154 Q5.1 (“consumed locally … not fanned out”), which
predates per-direction mode. The visible cost is that a two-hop topology —
A --sstp--> goSignals --sstp--> B, aud-routed — silently drops hop 2. The
workaround was RFC 8935 push for the inbound leg, which forfeits SSTP’s
single-request bidirectional exchange and multi-SET batching.
D1 — Inbound routing is governed by the inbound direction’s RouteMode.
The guard now consults it: IMPORT returns as before; FORWARD and PUBLISH
fall through to the same fan-out an RFC 8935 push receiver uses. streamState
at that point is the rx-side view built by sstpInboundCounterRecord, whose
StreamConfiguration is the pair’s SstpInbound, so GetRouteMode() already
returns the inbound mode — no new lookup is needed.
D2 — The forward-vs-re-sign choice is NOT made on the inbound path. It is
made per outbound stream at delivery time, from that stream’s own route mode
(delivery/http.go forward(), and buildSstpOutboundSets in
runner_sstp_server.go), which is how the push path already works. The inbound
mode decides only whether the SET is routed. This keeps one signing decision
point rather than two that could disagree.
This deviates from the issue’s acceptance criteria, deliberately. GH #261
asks for a test proving the SET arrives “re-signed / verbatim respectively” for
inbound PUBLISH / FORWARD. That is not implementable as written: on the
inbound leg the two modes are indistinguishable, because nothing about signing
has happened yet. An outbound stream in FORWARD mode forwards verbatim even
when the inbound direction is PUBLISH. The AC is therefore read as satisfied
by proving the SET is routed under both modes, with signing left to the
existing outbound-side tests. Recorded here rather than silently dropped.
D3 — The check cannot reuse IsReceiver(). That helper matches
ReceivePush / ReceivePoll only, and an SSTP inbound’s delivery method is
ReceiveSstp, so the pre-existing IsReceiver() && RouteModeImport line does
not fire for SSTP. The SSTP branch is therefore explicit rather than folded into
that condition. Widening IsReceiver() was rejected: it is used elsewhere to
mean “RFC8935/8936 receive-side”, and changing it would move behaviour outside
this issue.
D4 — “No inbound mode” normalises to IMPORT, not to
SstpModeToRouteMode’s PUBLISH default. sstpInboundRouteMode folds two
cases into IMPORT:
RouteMode. The bootstrap always stores an explicit mode
(buildSstpRecord), so blank means a record written before the field existed.SstpInbound. sstpInboundCounterRecord leaves the tx
StreamConfiguration in place when a pair has no inbound half, so reading the
mode off that view would return the tx direction’s mode and route on it —
a pair with no inbound direction cannot have an inbound mode. Harmless while
the guard returned unconditionally; a live mis-route once it stopped.Both behaved as import-only under the old guard, and honouring the PUBLISH
default would silently start fanning out their events on upgrade — a data-flow
change no operator asked for. New pairs are unaffected.
The normalisation lives in the helper rather than in the caller so the caller
can make exactly the same == RouteModeImport test the push path makes.
D5 — A SET is never routed back out the pair it arrived on.
routeEventToSstpPairsLocked takes an excludeTxSid. The originating pair’s
outbound direction frequently matches the event on aud, so without this the
fan-out would return the SET to the peer that just sent it.
The tx SID is the exclusion key, not PairId. It identifies the pair in
both fan-out maps — initiator pairs are keyed by PairId, which the aliasing
invariant makes equal to the tx SID, and responder pairs are keyed by the tx SID
directly — so one key covers both loops with an identical test, and it stays
correct on a record whose PairId was never populated (where a PairId-keyed
exclusion would silently no-op and echo).
This is a pair-level exclusion, not a general loop suppressor. A longer cycle across distinct pairs (A→B→A) is still possible and is out of scope here; SSTP has no hop count or path record to detect it with.
independentid/i2gosignals-ai#2 no longer
needs the RFC 8935 push workaround for its inbound leg.docs/SSTP.md’s per-direction claim becomes true rather than aspirational.IMPORT (D4) where the push path falls
through to routing. That asymmetry is the price of not changing behaviour for
existing SSTP records, and it disappears once no blank-mode records remain.FORWARD/PUBLISH starts routing events that
were previously dropped. That is the fix, but for anyone who configured a
non-IMPORT inbound mode and adapted to it not working, event volume on
downstream streams changes at upgrade.HandleEvent now carries a second piece of SSTP-specific branching, and
holds the resolved pair (sstpPair) across the whole fan-out block to derive
the exclusion from it.docs/SSTP.md — pair model, bootstrap, per-direction mode semantics.route_mode — together with iss, aud and the issuer JWKS URL — is now
updatable after creation rather than create-only, on every delivery method
and on each SSTP side addressed by its own SID (PairId / tx SID → the
primary transmit direction; SstpInbound.Id → the inbound direction).
route_mode is validated by the targeted direction’s role: a transmit
direction accepts PB | FW, a receive direction accepts IM | FW; any
other value is rejected with a 400 naming route_mode, and an empty value
means unchanged. The vocabulary split follows the two read sites this ADR
describes — a transmitter tests only == FW, a receiver only == IM — so a
value from the wrong vocabulary would be mis-read rather than refused. An SSTP
update is local to the patched side; the peer is not notified. D1–D5 above are
unchanged: the inbound mode still decides only whether an SSTP-ingested SET
is routed, and the sign-vs-forward choice stays on the outbound stream.