- decomposes the ctrlchan, xlink and edge-listener channels onto the v5 Senders, MessageSourceProvider and UnderlayEventListener interfaces, replacing the v4 UnderlayHandler god-interface
- replaces the hand-rolled dial/grouping/backoff machinery with channel.BackoffDialPolicy and declarative Constraints; ctrl keeps survive-to-zero (Min: 0) with MinStableDuration: 0 for prompt reconnect, while xlink and edge default underlays keep Min: 1 so loss closes the channel
- builds grouped channels via channel.NewChannel(*Config) and moves handler retrieval to GetSenders()
- records the channel via InitChannel from each bind handler, before underlay events fire, so handlers registered during bind do not dereference a nil channel
- generates a group secret for ungrouped inbound ctrl underlays on the router accept path, matching the controller, since NewChannel requires one
- preserves link-id-as-channel-id (the link dial policy wraps the cloned link-id identity dialer) and adds a test asserting dialed underlays present the link id
- registers the latency handler explicitly, as it is no longer a self-describing receiver in v5
- channel.NewChannel(name, factory, bindHandler, opts) -> channel.NewSingleChannel(...)
- channel.NewChannelWithUnderlay(...) -> channel.NewSingleChannelWithUnderlay(...)
channel/v5 repurposes NewChannel for the unified multi-underlay constructor, so the
single-underlay call sites move to the renamed helpers. Mechanical rename only; like the
preceding import commit it does not build on its own.
- moves the channel dependency to channel/v5 v5.0.10 and sdk-golang to v1.9.0 in the root and zititest modules
- mechanically rewrites every channel/v4 import path to channel/v5
This is the import-path-only step; the API-level changes the switch requires land in the following commit. This commit does not build on its own.
- adds an in-process end-to-end test that starts the agent, registers recording
callbacks, and exercises AppInfoV2, the three v2 channel commands, and the
framed-through-callback path
- adds a developer note (common/agent/README.md) explaining the two-tier
capability model and how to add an agent capability, register an app
capability, add a v2 channel command, and preserve wire compatibility
- adds the agent-local LogLevel enum and a capability registry
(AgentLoggingSlogLevels, the names table, mask / string-list / bit-from-string
helpers, RegisterAppCapabilities) that freezes on Listen and panics on late
registration
- adds AppInfoV2 (framed op 0x16) returning identity plus the two capability
lists, with a client-side reader that falls back cleanly to the legacy
AppInfo when an old server closes on the unknown op
- carries the agent capability bitmask in the channel hello, with
CapabilitiesFromHeaders to decode it
- adds three v2 channel commands (SetLogLevelV2, SetChannelLogLevelV2,
ClearChannelLogLevelV2) in the agent-reserved 30000+ content-type band,
carrying parameters as channel string headers
- routes both the v2 channel handlers and the legacy framed handlers through a
registered LogLevelCallbacks, falling back to today's logrus / pfxlog
behavior when no callback is registered
- HandleChannelConnection auto-binds the v2 handlers on every agent channel
when callbacks are registered
- the v2 handlers emit the same pfxlog audit Info lines as the framed handlers,
so server-side audit output is identical across both paths
The agent listen goroutine read the package-global listener for both
Accept and the deferred Close. Tests that cleared the global after
calling Close (so subsequent Listen calls work) raced with the
goroutine and could trigger a nil-pointer panic in the deferred close.
The goroutine now keeps its own *net.Listener captured at launch
time. Close (and any test cleanup) can manipulate the global without
the goroutine ever seeing the change; the deferred Close on the
already-closed listener is a benign no-op that just logs.
Caught by TestLogLevelCommandsEndToEnd on the agent-capabilities
stack; the racy code was inherited from upstream openziti/agent
during the absorption commit.
- adds HandleChannelConnection (server-side conn-to-channel upgrade) and the
client-side NewChannel/ConnToChannel/MakeChannelRequest helpers to common/agent;
these import channel/v4 + identity, which are already root-module deps, so there
is no go.mod or Go-version change
- replaces the duplicated agent channel-upgrade handlers in controller, router,
tunnel, and demo with one-line delegations to common/agent.HandleChannelConnection
- moves the CLI-side channel dialer (was NewAgentChannel/connToChannelMapper/
MakeAgentChannelRequest in agentcli) into common/agent and repoints the agentcli
and demo callers
- normalizes the demo echo-server to accept the AppIdAny wildcard, matching the
other agent servers; previously it rejected it
- preserves the wire protocol (leading app-id byte, "agent" channel, 1s connect
timeout), so existing channel-based agent commands are unchanged
- moves the openziti/agent library source (5 files) into common/agent and drops
the external github.com/openziti/agent dependency from the root and zititest modules
- re-points all 21 importers to the in-tree path; the package name stays agent, so
call sites are unchanged, and the wire protocol (Magic bytes, op constants, gops
socket prefix) is identical
- promotes go-ps to a direct dependency (now imported by common/agent); go mod tidy
also reclassifies golang.org/x/exp as indirect, a pre-existing staleness fix