ADR-091 amended 2026-07-17: CallCredentials removed (not retained in alknet-call). Trace showed CallCredentials.auth_token had no reader (connect() read only tls_identity + remote_identity; spawn_dispatch takes no credentials; from_call's credentials_auth_token was a different type, always None, never connected). auth_token is a per-request payload field — browsers send it in the WS payload; the HTTP gateway resolves bearer → Identity at its boundary. from_call's credentials_auth_token dead path removed in the same pass (OpSummary field, handler params, build_forwarded_payload param, and the two tests asserting the never-exercised Some path). ADR-089 §5 further amended, ADR-080 noted, all spec READMEs and overview updated. Migration plan (findings.md) corrected: Phase 5 prune now includes CallCredentials removal + from_call dead-path removal; test audit corrected (4 unchanged + 2 move to core, not 6 unchanged); integration-test split documented; all 'or' hedges resolved.
5.5 KiB
5.5 KiB
OQ-66: alknet/register Wire Protocol
- Origin:
docs/architecture/decisions/089-alknetclient-native-dial-seam.md§6;docs/architecture/crates/client/README.md§"alknet/register". - Status: deferred(scope)
- Door type: one-way (the wire protocol — once native workers and hubs exchange registration frames, the format is compatibility-locked)
- Priority: medium
- Impacts: Blocks native worker registration over QUIC/TCP+TLS without HTTP. A worker that has no HTTP client (a minimal native worker, an iroh-only deployment) cannot enroll its key with a hub until this is specced and implemented. The HTTP registration endpoint (OQ-58) remains the first implementation, so this does NOT block the first hub deployment (web + native uses HTTP registration for worker provisioning). It blocks the native-only registration path and the no-HTTP minimal-hub case.
- Blocked on: OQ-58's token model (one-time vs. refresh,
single-use vs. multi-use, rotation). The
alknet/registerwire protocol and the HTTP registration endpoint (OQ-58) share the enrollment semantics and the token model — they should converge on one model before either's wire format is locked. OQ-58 is open (resolvable now); this OQ is blocked on its resolution. The frame-format fork (reuseEventEnvelopevs. standalone) and the enrollment-trait shape (point 5) are independently workable but not independently decidable — they depend on the token model. - What is decided (ADR-089 §6):
alknet/registeris a dialable ALPN — an entry point (ADR-086 §2) accepted without an established peer identity. Two registration cases exist, both hub concerns and both optional:- Token registration — a freshly-provisioned worker (docker,
vast.ai, runpod) generates its local identity, dials the hub on
alknet/register, presents a one-time registration token, and enrolls its key. The hub creates aPeerEntry(mixed-fingerprint shape, ADR-034 §3) and returns a session credential. - No-token (open) registration — a hub that hosts public
services over channels, or a relay/gateway, accepts registration
without a token. The enrollment creates a
PeerEntrywith no token requirement. The dial is the same as any other ALPN (AlknetClient::dial_quic/dial_tcp_tlsonb"alknet/register"); the difference is the handshake protocol on the resultingConnection.
- Token registration — a freshly-provisioned worker (docker,
vast.ai, runpod) generates its local identity, dials the hub on
- What is open: the wire protocol — the handshake on the
Connectionafter the dial. Specifically:- Frame format — does
alknet/registerreuse the call protocol'sEventEnvelopeframing (length-prefixed JSON), or does it have its own minimal framing? Registration is a one-shot request/response (send public key + token, receive session credential), not a long-lived call session. ReusingEventEnvelopeties the register ALPN toalknet-call(a dependency); a minimal own-format keeps it standalone but adds a second wire format. - Token model — one-time vs. refresh, single-use vs. multi-use,
rotation. This is the same open question as OQ-58 (the HTTP
registration endpoint's token model). The two paths should share
the token model — a token issued by the hub works over both HTTP
and
alknet/register. - No-token policy — who decides whether a hub accepts
no-token registration? Is it a
DynamicConfigflag, anIdentityProviderpolicy, or a hub-crate config? WhatPeerEntryshape does an open-registration enrollment produce (noauth_token_hash, fingerprint-only)? - Session credential return — what does the hub return on
successful registration? A
PeerEntry? A session token? Both? How does the returned credential feed into the subsequentalknet/channelsconnection'sConnectionCredentials? - Relationship to OQ-58 — the HTTP registration endpoint
(OQ-58) and
alknet/registershare the enrollment semantics (createPeerEntry, return credential) but differ in transport (HTTP vs. raw ALPN). Should they share an enrollment trait inalknet-hub, with the HTTP endpoint and thealknet/registerhandler as two transport-specific front-ends? Or are they separate handlers that happen to call the sameIdentityStorewrite path?
- Frame format — does
- Resolution: Not yet decidable. The token model (point 2) is the
shared dependency with OQ-58 — both paths should converge on one
model. The frame format (point 1) is a genuine fork: reusing
EventEnvelopeadds analknet-calldependency to the register path (which may be fine — the hub already depends onalknet-call); a standalone format keeps register minimal but diverges. The relationship to OQ-58 (point 5) is the shape question that determines whether the register handler lives inalknet-hub(alongside the HTTP endpoint) or in a separate crate. These need a dedicated ADR that works through the token model, the frame format, and the enrollment-trait shape together — they are not independently decidable. - Cross-references: ADR-089 (§6 — names the ALPN and its
entry-point role; defers the wire protocol to this OQ), OQ-58
(worker registration flow — the HTTP path; shares the token model),
ADR-086 (§2 — entry-point vs. endpoint ALPN distinction),
ADR-034 (§3 — the mixed-fingerprint
PeerEntryshape token registration creates), ADR-072 (channel 0 identity resolution — the path the session credential feeds into).