SSTP is goSignals’ third SET delivery method, alongside RFC 8935 push and
RFC 8936 poll. It is defined by draft-hunt-secevent-sstp-00
(docs/specs/draft-hunt-secevent-sstp-00.txt) and lets two nodes exchange SETs
in both directions over a single HTTP request/response cycle: the initiator’s
outbound SETs ride the request body while it long-polls for the responder’s
inbound SETs in the response.
Unlike push and poll — each a single direction modelled by one
StreamStateRecord — an SSTP pair is one bidirectional relationship. This
doc covers the pair model, bootstrap, the peer cascade, per-direction mode,
pair status semantics, and the operator runbook. The wire format and error
taxonomy live in pkg/goSetSstp and the source spec.
The focused per-direction status/verify runbook (formerly a standalone rider doc) is folded into this document — see the operator runbook.
Push and poll each model one direction. A bidirectional relationship between two nodes therefore needs two streams per node — four stream IDs, two bearers, two endpoint URLs, two lease owners across the pair. SSTP collapses that to one logical pair per relationship, carried over a single HTTP cycle, halving the management surface. It suits peers that want a symmetric, firewall-friendly exchange where the initiator dials out and both directions multiplex on the one connection.
An SSTP pair is one StreamStateRecord per node, carrying both directions
(ADR 0018):
| Concept | Where it lives | Notes |
|---|---|---|
| txSid (transmit / outbound) | primary StreamConfiguration.Id |
Aliased to the Mongo _id and to PairId. Its Delivery is a marker only (urn:i2-open:secevent:delivery:sstp). |
| rxSid (receive / inbound) | SstpInbound.Id |
Its Delivery is a marker only (urn:i2-open:secevent:delivery:sstp:receive). |
| PairId | PairId |
A fresh ObjectID hex; the on-wire SSF stream_id and the {id} in POST /sstp/{id}. Equals txSid. |
| Pair-scoped connectivity | SstpMethod |
Role, EndpointUrl, AuthorizationHeader, PeerPairId. Secrets/endpoints live here, not in the per-direction Delivery objects, so SSF discovery/management responses never leak per-pair credentials. |
| Pair status | Status/ErrorMsg (tx) and InboundStatus/InboundErrorMsg (rx) |
Every status write — enabled, paused, disabled — moves both halves, because the two directions share one HTTP exchange (the same single status a push or poll stream has). |
GetType() returns the goSignals-internal discriminator DeliverySstpPair
whenever SstpMethod is set. That is not an SSF wire URN — the advertised URN
is urn:i2-open:secevent:delivery:sstp, published unconditionally in
delivery_methods_supported on every server’s .well-known/ssf-configuration so
peers can discover SSTP support without per-server config.
Two DAO accessors locate a pair: FindByPairId(pairId) and
FindByInboundSID(sid), both backed by sparse-unique Mongo indexes (pair_id,
sstp_inbound.id). Non-SSTP records lack both fields and pay zero index cost.
sstp-client:<PairId> lease.POST /sstp/{id}, derives its
own EndpointUrl (/sstp/<PairId>), and mints its own per-pair bearer. It
takes no cluster lease, so every node can serve the endpoint.Role is required at create with no default — the “both peers responder”
misconfiguration is rejected outright.
SstpPairBootstrap DTOA pair is provisioned by POST /stream with a second body shape,
SstpPairBootstrap, discriminated on shape alongside the existing
StreamConfiguration (ADR 0019). A body is an SSTP bootstrap when it carries a
top-level role of initiator/responder together with at least one
per-direction primary/inbound object. A malformed body falls through to the
StreamConfiguration path. There is no /pairs endpoint — create rides the
existing POST /stream surface.
Fields:
role, endpoint_url, authorization_header,
peer_server_alias, peer_pair_id, description.primary = transmit, inbound = receive): iss,
iss_jwks_url, aud, events, mode, receive_mode, event_source.
mode and event_source.type are the two independent ADR 0004 axes — whether
the direction re-signs, and where its events come from — and each half answers
both for itself (#296). An absent event_source routes that leg as DIRECT.
The optional receive_mode (IMPORT | FORWARD) gives the direction’s
receiving end its own choice (#306); see
Receive mode.StreamService.CreateSstpPair validates and expands the bootstrap:
PairId is minted fresh and aliased to txSid and _id; rxSid gets its own
fresh SID.EndpointUrl and server-mints the per-pair
bearer (IssueSstpPairToken, covering both SIDs). An operator-supplied
endpoint_url or authorization_header on a responder is rejected.authorization_header (the bearer
the peer responder minted); endpoint_url is operator-supplied or learned via
the cascade response.EndpointUrl is validated syntactically only — scheme https or http,
non-empty host, no query/fragment. No network probe; reachability is the
runner’s concern (matching push/poll). An initiator’s http endpoint is
additionally refused by the business-stream TLS floor unless the bootstrap
sets tx_allow_plaintext: true (carried to the peer mirror and re-checked at
dial time); a responder serves its endpoint and is never subject to it.iss and aud and a recognized mode; a
present receive_mode must be IMPORT or FORWARD (anything else, PUBLISH
included, is a 400 naming <half>.receive_mode). iss and aud are
JWT StringOrURI values (RFC 7519 §2), so a bare hostname is legal: a non-URI
value is accepted with a WARN rather than refused, because the SSF profile’s
use of URIs is a convention and a strict peer refusing it is an interop fact
worth logging, not a create-time rule. A present event_source must carry a
recognized type, and must name at least one source_stream_ids entry under
EXPLICIT — the rules validateEventSource already applies to push and poll,
so a pair cannot build a direction those two would refuse. No reciprocity is
enforced between halves, so asymmetric/multi-hop pairs are first-class.event_source descriptors are stored on the halves they describe: the
primary’s on the record-level StreamStateRecord.EventSource, which is what
MatchesStream reads when deciding what the pair transmits, and the inbound’s
on the InboundEventSource twin, following the
InboundStatus/InboundErrorMsg convention. This node never routes on the
inbound one — the transmitting end of that logical stream is the peer, and
mirrorSstpBootstrap delivers the same descriptor there as the peer’s primary,
where it is live.receive_mode is echoed as bootstrapped on the record-level
receive_mode (primary) and inbound_receive_mode (inbound) fields, following
the same twin convention, so a pair read (GET /state, GET /states) shows
both ends of each direction. Both are omitted when the bootstrap did not carry
the field.Status/InboundStatus are always Enabled at create — the runner
self-pauses on first failure. There is no “pending” state.When peer_server_alias is present, the service cascades the mirrored
bootstrap to the peer using the stored Server credentials (the same
foreign-server credential path the rest of goSignals uses; requires admin).
The mirror flips the role (initiator↔responder) and swaps the two
directions, so the peer’s primary is this node’s inbound. On success the
local record records the peer’s PairId in SstpMethod.PeerPairId.
Rollback is role-asymmetric:
Omitting peer_server_alias provisions only the local half; peer connectivity is
patched later via UPDATE.
mode is per direction and maps to the existing RouteMode
(SstpModeToRouteMode):
| Mode | RouteMode | Behaviour |
|---|---|---|
FORWARD |
RouteModeForward |
Preserve the upstream iss; the SET is forwarded verbatim (no re-sign). |
PUBLISH |
(re-sign) | Re-sign with goSignals’ issuer key for that direction (iss/aud from the direction’s config). |
IMPORT |
(local) | Keep events local. |
Because mode is per direction, a pair can FORWARD outbound while PUBLISH-ing inbound, etc.
A direction has two ends, and they read its route mode differently: the
transmitting end asks only “FORWARD?” (relay verbatim, or re-sign), the
receiving end only “IMPORT?” (keep it, or route it on). With mode alone both
ends are written from one word — one node’s transmitter and the peer’s receiver
for the same direction — so the four real combinations collapse to three, and
“relay verbatim, import only” cannot be expressed.
The optional per-direction receive_mode separates them:
mode (transmitting end) |
receive_mode (receiving end) |
Receiving end’s RouteMode |
|---|---|---|
| any | absent | from mode, exactly as before the field existed |
| any | IMPORT |
IM |
| any | FORWARD |
FW |
PUBLISH is not a valid receive_mode: on receipt it is indistinguishable from
FORWARD (ADR 0031 D2).
On a node, the primary is the transmitting end and the inbound half the receiving
end. So inbound.receive_mode sets this node’s sstp_inbound.route_mode, while
primary.receive_mode is the choice for the peer’s receiving end: the
mirror’s whole-direction swap delivers it to the peer as its
inbound.receive_mode. A direction without the field marshals without the key,
so a bootstrap that omits it — and its mirror — is byte-for-byte unchanged.
The echo is kept truthful on the one side this node owns: a route_mode patch
on the inbound SID moves inbound_receive_mode with it. receive_mode (the
peer’s choice) is not changed by any local patch, just as a peer is not told of
any other local pair update.
The inbound (rx) mode decides whether an SSTP-ingested SET is routed onward, exactly as the equivalent mode does on an RFC 8935 push receiver:
| Inbound mode | Routed to other streams? |
|---|---|
IMPORT |
No. The SET is consumed locally — persisted and available to local readers, but never fanned out. |
FORWARD |
Yes, to every matching outbound stream (aud- or explicitly-routed). |
PUBLISH |
Yes, to every matching outbound stream. |
FORWARD and PUBLISH are identical on the inbound leg. Both mean “route
onward”; the inbound mode does not decide whether the SET is forwarded verbatim
or re-signed. That choice belongs to each outbound stream and is made at
delivery time from that stream’s own route mode — exactly as on the push path.
So an outbound stream in FORWARD mode forwards verbatim even when the inbound
direction is PUBLISH, and vice versa. Read the mode table above this section
for the signing behaviour of a given direction; read this one only for whether
an inbound SET travels further.
This is what makes a two-hop topology work: in
A --sstp--> goSignals --sstp--> B, hop 2 happens only when the inbound
direction of the A-pair is FORWARD or PUBLISH. Under IMPORT the SET stops
at goSignals.
Note the two different “defaults” here. A bootstrap that omits mode maps to
PUBLISH (SstpModeToRouteMode), so a newly created pair stores an explicit
mode either way. A persisted record whose inbound RouteMode is blank
predates per-direction mode; those are treated as IMPORT, which is how they
behaved before inbound routing was honoured, so upgrading does not start
fanning out their events.
A SET is never routed back out the pair it arrived on, even when that pair’s
outbound direction matches it on aud.
Mode decides whether an inbound SET travels further; events_delivered decides
which SETs any given outbound stream accepts. A direction’s events are
negotiated at bootstrap against this server’s supported-event catalog, and the
router matches a SET’s event types against the result — so an event type outside
the catalog is dropped by every hop regardless of mode.
That matters most for a two-hop topology carrying a custom vocabulary: the
SETs arrive, verify, and persist, and then go nowhere. Set
I2SIG_EVENT_TYPES_EXTRA on every goSignals node in the path to add those URIs
to the catalog — see docs/configuration_properties.md (§ Event) for the format
and for how an extended type interacts with I2SIG_STREAM_EVENT_VALIDATION.
Negotiation happens at bootstrap only: PATCH on a pair is a narrow
whitelist that does not touch events, so a pair created before the vocabulary was
configured has to be recreated to carry it.
Note also that an SSTP direction naming no events forwards nothing (unlike
SSF registration, where an omitted events_requested means “everything you
support”); a WARN is logged at create.
sstp-client:<PairId> Mongo lease (30 s lease, 10 s
heartbeat), mirroring the push-transmitter lease. A jittered takeover delay
spreads thundering-herd after a cluster blip.EventPollBuffer; recovery after takeover reads
the persisted pending JTIs directly from the provider when the buffer is empty.DeliverSstp, and
classifies the response with the goSetSstp classifier:
tfr=SSTP, stream_id=txSid).POLL_RETRY_*; does not
pause.returnEvents=false) flushes newly-queued
outbound SETs without disturbing the held cycle. At most one secondary push is
in flight per pair; it keeps claiming and sending batches until the outbound
is empty, so wakes coalesced while it was in flight are not lost.returnEvents=true is the
long poll the responder parks until it has SETs for us.sstp-server:<txSid> (#365): the owner holds the pair’s one
outbound queue. Every node can still answer POST /sstp/{id} and ingest its
inbound SETs; a non-owner sends the request’s acknowledgements and its ask
for events to the owner in one /_cluster/claim call (see
Cluster.md). A request that
neither acks nor asks for events makes no Claim.InboundStatus): each SET is byte-identical to an
RFC 8935 SET and parsed with goSetPush.ParseReceivedSET, then persisted via
HandleEvent keyed on rxSid (so the inbound counter carries
tfr=SSTP, stream_id=rxSid). A duplicate JTI is swallowed by the #153
ingestion short-circuit but still acked so the sender stops resending.503 Service Unavailable and a Retry-After header
(I2SIG_INGEST_RETRY_AFTER, default 2 seconds). Nothing in the exchange is
acked and the outbound drain is skipped, so the peer resends; any SET stored
before the failure comes back as a duplicate and is acked then (issue #333,
ADR 0038). See the ingest status table in
operations.md.Status): waits on the pair’s outbound
EventPollBuffer for the request duration, reusing
I2SIG_POLL_DEFAULT_TIMEOUT / I2SIG_POLL_MAX_TIMEOUT (no SSTP-specific
knob). The wait ends when the request context is cancelled (the client
aborts), as the RFC 8936 poll-transmitter handler’s does (#365).returnEvents=false, so the
cycle keeps running and resumes on unpause or re-enable. A 4xx is reserved for
the deleted/unknown pair case — HTTP status is the primary error signal.Two routes mirror /_cluster/wake-transmitter, kept separate for telemetry; both
reuse the wake-transmitter auth (SPIFFE mTLS peer cert, else the
I2SIG_CLUSTER_INTERNAL_TOKEN shared-HMAC bearer) and the same coalescing
window:
POST /_cluster/wake-sstp-client — body sid = PairId. Broadcast when a
node receives an inbound event whose target client pair is owned by a different
node, so the lease owner drains it into the next outbound cycle.POST /_cluster/wake-sstp-server — body sid = txSid. Broadcast when an
outbound event matches an SSTP-server pair, so a held long-poll returns it
immediately.See docs/Cluster.md for the lease/wake-up internals.
POST /sstp/{id} where {id} is the PairId (on-wire stream_id):
Allow: POST).Content-Type: application/sstp+json (parameters such as ; charset=utf-8
are accepted; a mismatch → 415).StreamIds=[txSid, rxSid] (the internal SIDs), not the PairId on the path.
The handler resolves the record via FindByPairId/GetStreamStateByPairId
and authorizes against the actual txSid/rxSid for scope=event. A token minted
for a different pair cannot act on this one. See docs/security_model.md.From the client (initiator) side; the named server alias’s stored credentials cascade the mirrored half to the responder:
# Symmetric (same iss/aud/events/mode both directions):
goSignals create stream sstp <client-alias> <server-alias> \
--iss https://issuer.example \
--aud https://peer.example \
--events urn:ietf:params:SCIM:event:prov:create:full \
--mode PUBLISH \
--name my-pair
# Asymmetric / multi-hop (full SstpPairBootstrap with per-direction primary/inbound):
goSignals create stream sstp <client-alias> <server-alias> \
--bootstrap-file ./pair.json
Flag note: the asymmetric input flag is
--bootstrap-file(not--config— the global--configflag, GOSIGNALS_HOME, already owns that name). A.yaml/.ymlextension is parsed as YAML; anything else as JSON.--bootstrap-fileand the symmetric flags are mutually exclusive.
The command prints the PairId, both pair SIDs, and the resolved
EndpointUrls. The issuing side plays initiator; the named server alias is the
responder the bootstrap cascades to.
SSTP pairs appear in the existing flat GET /states listing — there is no
/pairs endpoint. Tools expand each pair record into two rows (txSid + rxSid)
grouped client-side by PairId.
GET /status?stream_id=<sid> accepts either SID of the pair:
stream_id=<txSid> → Status + ErrorMsg (outbound).stream_id=<rxSid> → InboundStatus + InboundErrorMsg (inbound).Status writes keep the two halves equal (see below), so both SIDs report the same status and reason.
POST /status accepts either SID too, and every status is pair-level:
pausing, resuming (enabled), or disabling through txSid or rxSid moves both
directions together. Pausing an SSTP pair pauses its HTTP exchange, so both
logical streams stop — consistent with a push or poll stream, which has one
status. A paused pair’s POST /sstp/{id} returns 200 with
returnEvents=false so the cycle resumes cleanly on unpause. A legacy record
whose halves differ heals on its next status write. A one-way (single-direction)
pause is not supported today.
UPDATE enforces a patchable-fields whitelist: Role, an already-set
EndpointUrl/PeerPairId, and all IDs are immutable, so a live pair can never
be accidentally repointed at a different peer. Delete is the only sanctioned way
to break a pair’s peer binding.
POST /verify with {"stream_id": "<sid>"} targets the outbound side of the
direction the SID names, emitting an SSF verification SET scoped to that
direction’s iss/aud:
stream_id=<txSid> → verifies the transmit direction from this node.stream_id=<rxSid> → verifies the inbound direction’s outbound leg.Reverse-direction verification (confirm the leg the peer transmits into
your inbound side) is ordinary SSF transmitter-initiated verification pointed at
the peer: resolve the peer’s transmitter config and POST <peer>/verify with
{"stream_id": "<peer's txSid>"} (= your rxSid’s upstream), authenticated with
the bearer the peer accepts. The peer emits the verify SET, which arrives on your
rxSid. No new local route is needed.
Local cleanup always proceeds and never blocks on peer reachability (ADR
0020). Peer cleanup is a courtesy, opt-in via ?cascade_peer=true:
# Local-only delete (peer untouched): 200
DELETE /stream/<sid>
# Courtesy peer delete too:
DELETE /stream/<sid>?cascade_peer=true
cascade_peer (or no resolvable peer Server): no peer call;
LocalDeleted=true → 200.cascade_peer=true: a courtesy DELETE is sent to the peer’s stream-config
endpoint for SstpMethod.PeerPairId.
PeerPairId was never learned →
the local row is already gone; the per-side error is reported and the
handler answers 207 Multi-Status with the outcome body. Read the body to
distinguish a clean cascade from a partial one.SSTP reuses the poll long-poll and retry knobs — there are no SSTP-specific timeout knobs:
| Variable | Used by SSTP for |
|---|---|
I2SIG_POLL_DEFAULT_TIMEOUT |
server-side outbound long-poll timeout |
I2SIG_POLL_MAX_TIMEOUT |
server-side outbound long-poll cap |
I2SIG_POLL_RETRY_BASE_DELAY / _MAX_DELAY / _BACKOFF_FACTOR |
client-side transport/transient backoff |
(retired) I2SIG_INSECURE_SSTP_HTTP |
no longer read — a plaintext initiator endpoint_url needs the pair’s tx_allow_plaintext opt-out instead |
I2SIG_EVENT_TYPES_EXTRA |
extend the supported-event catalog so a pair can negotiate and route a custom event vocabulary |
See docs/configuration_properties.md for the full catalogue.
docs/specs/draft-hunt-secevent-sstp-00.txt — the source spec.StreamStateRecord per pair.cascade_peer opt-in, 207 partial.mode governs routing, not just signing.docs/Cluster.md — sstp-client lease + wake-up endpoints.docs/security_model.md — pair bearer / StreamIds[] / FindByPairId.docs/Metrics.md — tfr=SSTP counter label.(C)2026 Independent Identity Inc.